Having A Variable That Depends On The Url Of The Page?
Apr 17, 2011
For example, if the pages are called:
[URL]
I'm trying to put in a "next" and "previous" page function, but i want the code on every page to be the same because I'm using the same PHP include on every page. I want to use the number (last directory) in the URL as my variable, so that even with the same javascript on every page, every page will have a different variable so that the "next" and "previous" links can go to the right page.
View 4 Replies
ADVERTISEMENT
Feb 6, 2009
I wonder javascript execution speed depends on what ?
Meanwhile, if a flash slide show vs flash-like javascript slide show, which one will win due to download speed and execution speed?
View 2 Replies
View Related
Sep 30, 2006
i am developing a web based application in that i have to display the menu depends on the user.if it is admin the admin menu should display if it is otherone the admin menu should not display.
the menu contents should hide dynamically using cookies concept for all the users the menu is same but the menu should hide dynamically using style.display="visible" or hide
first of all i am trying to hiding the menu contents dynamically using onload method but that is not working Code:
View 7 Replies
View Related
Jun 20, 2010
for example, i have a dropdownlist
<select id="Type">
<option>Single</option>
<option>Mutiple</option>
</select>
when i select Single, i want to generate 2 radio button. instead, generating 2 checkboxes if Mutiple was selected. can anyone show me how to do it?
View 2 Replies
View Related
Jun 15, 2010
My requirement is that whether a dropbox (select box) is displayed depend on another dropbox's state/value.e.g. Whenthe country is US,the state is displayed; whenthe country is Canada,theprovinceisdisplayed. i.e. The user choose the country, then the correspondingstate orprovince will bedisplayed. Is there any sample code or tutorial to do that?
View 2 Replies
View Related
Apr 26, 2011
I have a programing problem that have been around for ages. I have search on google using several expressions and words and after hours of digging i'm still unable to do it.I would like to get a value from a HTML page hosted remotely with an inconstant value. Then define this value and name as a javascript variable and apply or show in my page.P.S. Is there any way to make a domain lookup in javascript? I mean a user enters a domain and the script converts to an ip and shows to the user. If not thanks, probably it can only be done in the server side...
View 6 Replies
View Related
Aug 13, 2007
I have an url of a webpage. I would like to load the content of the webpage to a variable.
Sth like this:
variable = loadwebpage( url )
How to do it?
View 11 Replies
View Related
Dec 6, 2009
Right now I'm working on a website, and it has a hierarchical menu in the right and im also doing some content loading in a div, all that with javascript. My problem is that when they click on a link, I need to pass a variable "id" through the link. I dont want to pass it in the url, but I want to pass it in another way, for every link the id is going to be different. How can I pass a variable to another page and how can I retrieve it in that page so I can use it for the content loading?
View 1 Replies
View Related
Dec 20, 2010
I know I can make a link that reloads a page like this:
<a href="thispage.php">Refresh this page</a>
Or, using javascript:
<a href="javascript:location.reload(true)">Refresh this page</a>
I am starting from "thispage.php", and I want to reload it as "thispage.php?action=newversion"? (This page has a form that reloads the rest of the page with new data when refreshed with the action call).
Is there a javascript technique that would do this without calling the "thispage.php" part? The page includes a function that I need to be portable to any page that I place it on.
Obviously this is very wrong but I am trying to do this:
<a href="javascript:location.reload(true) . ?action=newversion">Refresh this page</a>
View 2 Replies
View Related
Apr 18, 2011
Is there a way to keep a variable value on page refresh, if I have
var x=0;
but then a users does somethibng that makes that value become
x=4;
and then the page is refreshed, is there a way to keep that value of 4 for the x variable or it will always reset to the original value?
View 4 Replies
View Related
May 17, 2004
I have a page with a form that a user completed. When they hit submit this calls some javascript. This javascript stores some XML in a variable and inserts the values from the form into the correct parts of the XML.
What I need to do is submit this XML or variable to another page. in effect, the use ris submitting the form to generate some XML then i want to send this XML to another page.
here is the code I have so far:
PHP Code:
<html>
<head>
<script>
function thename(){
var username = form1.username.value;
var password = form1.password.value;
var phone = form1.phone.value;
theXML = "<?xml version="1.0"?>
<novo-xml>
<register>
<client-id>test</client-id>
<password>" + username + "</password>
<user-id>" + password + "</user-id>
<phone-num>" + phone + "</phone-num>
<app-id>test</app-id>
<channel>I</channel>
<user-type>upgrade</user-type>
</register>
</novo-xml>";
//I was using this alert to display the XML
//alert(theXML);
}
</script>
</head>
<body>
<form name="form1" onsubmit="thename();">
username <input name="username"><p>
password <input name="password"><p>
phone <input name="phone"><p>
<input type="submit" name="submit">
</form>
</body>
</html>
View 9 Replies
View Related
Apr 19, 2009
Is there a function in javascript to get the source code of a page and contain it in a variable, or automatically obtain information from it in some way?For example, if I needed to get the title of a certain page, would I be able to somehow implement document.title to get the title of a webpage?
View 4 Replies
View Related
Sep 22, 2009
I am trying to use an onclick statement to go to an alternate web page displaying a different version of tha file being displayed in the current page.
In the HEAD section of the current page I have a global variable named currentfile that contains a file name. This function is also in the HEAD section immediately below the variable's declaration
I have tried every combination I can think of in the onclick code to get it to work but, no joy. here is an example:
I just can't get the next page to load.
View 15 Replies
View Related
Mar 8, 2006
This is for an ASP submission form. User creates a record, Access assigns a unique ID by Autonumber, I want to then pull that ID and insert into URL.
This is my code:
var addID
addID = '<%=(rsResults.Fields.Item("ID").Value)%>'
location.href=('?ID='+addID);
It adds the ID to my url fine, but it doesn't stop!
I've tried making a loop by this method:
var addID, looper;
looper=1;
while (looper < 2) {
addID = '<%=(rsTestResults.Fields.Item("ID").Value)%>'
looper=2;
location.href='results.asp?ID='+addID;
}
View 1 Replies
View Related
Aug 28, 2010
Code:
$(function() {
$("#slider").slider({
value:0,
min:0,
max: 10,
step: 1,
[Code]...
Question 1: How can i transfer the slider value to another page?
Question 2: I am using the price value in the slider from my previous page using the [VarName,S] variable. It shows the first time price value successfully as it brought from the previous page but once I slide forward and than slide back the value initiated to 0 instead of the value i carried from the previous page. How can I retain the min price value to the value i carried from the previous page?
View 1 Replies
View Related
Jul 24, 2011
I'm trying to make a cross domain iframe and want the iframe to dynamic resize the height. I have read that this is not possible, but if I own both domains I thought that I in my cross domian could make an variable which tells the height of the page and then send it via the iFrame to my page. My crossdomain page has a javasacript like this:
Code JavaScript:
var pageHeight = document.getElementById("container").clientHeight;
And my page would get the page like this:
Code HTML4Strict:
<iframe src="mypage.com" width="100%" height="The height from my crossdomain" frameborder="0" scrolling="no">
View 1 Replies
View Related
Nov 25, 2002
I want to pass the value of my <SCRIPT SRC= to my page in a variable e.g.
<script language="javascript">
if (location.search) {
var parmsrc = location.search.substring(1);
}
[Code].....
However, it is not working. Can this be done? I could not find it documented anywhere.
View 6 Replies
View Related
Mar 26, 2010
I need to write a script that parses a web page for a given delimiter and then stores the following 50 characters as a variable. I wrote the following php script:
Code:
<?php
$del = "picture_id";
$url = "http://xxxx.net/xxxxx/xxxxxx.php?do=xxxx";
$source = file_get_contents($url);
[Code]....
The delimiter is always going to be constant, however the succeeding characters will be different each and every time. I need to write this in Javascript because it is hosted on my server, and ran by users who post on my brothers message board (which is hosted elsewhere). Since Php is server side I always get "guest" as a value rather than the random string of characters like it should be.
View 2 Replies
View Related
May 26, 2011
I need to be able to change the variable in this line d.addBusDays(3); from the code below, based on the page title.
For example. Page Title 1 = 3 .... Page Title 2 = 6 .... Page Title 3 = 12
<p align="center"><br><b>Est. Shipping Date:</b><br> <br>
View 11 Replies
View Related
Oct 8, 2009
I'm using a plugin in Wordpress that checks for mobile browsers and sets a variable to "true" if a mobile browser is being used. I have a script I want to use on the same page where I'd like to use that variable rather than have to redo the check again. Is it possible to make a variable in one script global so that it can be used in a separate script on the same page? Greatly simplified, I mean ...
<script type="text/javascript">
var A = 1;
</script>
<script type="text/javascript">
Do something with A;
</script>
View 11 Replies
View Related
Apr 29, 2010
How do i set a page element as a variable and change it?
Ive googled the internet like crazy for an answer for this, but couldnt find it. Im trying to create an animation. My question is, how do i change the width of a div onclick?
Essentially, I want it to add one percent of the value of the width of the div every one second.[code]...
View 3 Replies
View Related
Sep 3, 2006
I have a form that posts data to a PHP mailer page I have created. When
it goes to the PHP mailer page it reads some of the data and modifies
the page accordingly using Javascript (hiding certain divs, etc...). My
goal, is to take all this data after it has been processed by
Javascript and send it through my PHP mailer as it is currently
formatted.
If it helps any, the track I am on right now involves encapsulating the
Javascript processed block in a div. I am then trying to take the
..innerHTML data from that div and store it in the PHP $message variable
for my mailer. This won't work because PHP is server side. So, I moved
on to generate some Javascript code (with PHP) that sends all that
messy HTML data that its processed through a URL variable to then be
read by PHP. This doesn't really accomplish what I want as it cuts off
about a quarter of the way through my data......
Any ideas??
One thing I thought of but don't know how to do or whether it's even
possible is using PHP to view the source of the current page and store
that as the HTML to be e-mailed. Or, is it possible to do something
similar to .innerHTML with PHP?
View 3 Replies
View Related
Jul 29, 2010
I need to append a session variable to all of the links on a page. Instead of manually going into each link, can jquery do this?
View 4 Replies
View Related
Jul 11, 2009
I am trying to get the current page HTML URL (the one at the top in the address box) and place it in a variable.
[Code]...
View 2 Replies
View Related
Jul 1, 2010
I've made the following script:
$(document).ready(function(){
var showHide = $.cookie('menuStatus');
alert(showHide);
/* Part that dosnĀ“t work.
if (showHide==closed) {
$("#menu").hide();
}
*/
$(".openClose").click(
function(){
$("#menu").slideToggle("slow", function() {
if ($(this).is(':hidden')) {
//var state = "closed";
$.cookie('menuStatus', 'closed');
} else if ($(this).is(':visible')) {
//var state = "open";
$.cookie('menuStatus', 'open');
}
//alert(state);
});
});
Now this is the example: [URL]. When page loads, you get an alert, with the var showHide, which should be open or closed. Problem is the if statement. I must say it was exciting to make this little script with jQuery. Especially setting the cookie, I couldn't have done it without the jQuery plugin. As you can see I tried to set a variable first but when page reloads, the variable was reset.
View 2 Replies
View Related
Apr 14, 2011
I have a base html page which contains several thumbnail images with links to enlarged images which I'd like to view in an external page [so I can control the dimensions of the enlarged image]. I thought it best to use an externaltemplate html page to launch these within and therefore imagine I need to declare the variable in the thumb links page & image they may need to look something like this:
<a href="mytemplate.html?imgVar=/images/collection/large1.jpg">thumb1.jpg</a>
<a href="mytemplate.html?imgVar=/images/collection/large2.jpg">thumb2.jpg</a>
<a href="mytemplate.html?imgVar=/images/collection/large3.jpg">thumb3.jpg</a>
Then in the external page pick up the variable something like:
<img src="imgVar">
I've looked all over Google & can only see something similar to this in php. Is there a way to achieve this with jQuery instead?
View 2 Replies
View Related