|
I am new to the JavaScript ,I know how to pass data from one html page to another html page but i don't know how to pass data from one html page to multiple pages.. Can anyone help me
|
|
|
|
|
We can probably help you, but first you'll need to explain precisely what you're trying to do.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Sir,
I had passed the values from one page to another page.But i don't know how to pass the values from one page to multiple pages.
|
|
|
|
|
You've already told us that in your previous post.
What you haven't told us is what you mean by passing to multiple pages.
It obviously means something to you, but the rest of us have no idea what you're talking about.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I had tried like this, passing the values from one page to another page
Below is my first page pass1.html
<html>
<head>
<script type="text/javascript">
function getParams()
{
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx !=-1)
{
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
for (var i=0; i<pairs.length; i++)
="" {
="" console.log(pairs.length);
="" nameval="pairs[i].split('=');
" params[nameval[0]]="nameVal[1];
" }
="" return="" params;
="" }
params="getParams();
firstname" =="" unescape(params["firstname"]);
lastname="unescape(params["lastname"]);
age" unescape(params["age"]);
document.write("firstname=" + firstname + " <br="">");
document.write("lastname = " + lastname + " ");
document.write("age = " + age + " ");
</script>
</head>
</html>
Below is my second page pass.html
<html>
<form type=get action="pass1.html">
First Name: | <input type=text name=firstname size=10> | Last Name: | <input type=text name=lastname size=10> | Age: | <input type=number name=age> | <input type=submit value="Submit">
|
</form>
</html>
|
|
|
|
|
OK. But you still haven't explained what you mean by passing the data to "multiple pages".
If you don't tell us what you want to do, we can't help you.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You can pass through posting, querystring, cookies, cache, localStorage, and probably etc, etc. You have to be way more clear as to what you want to do.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I am trying to add theme on my web pages on button click, but i am unable to do it.
Would you please tell me how to do it?
|
|
|
|
|
|
|
Thanks
|
|
|
|
|
|
If I am using an image of a paint brush with a clear background as my cursor image, is it possible to use Javascript to change its background color?
I would like to be able to select the background color of the cursor using a color picker.
I've been searching all over the web but haven't had much luck, please help.
|
|
|
|
|
I suggest you post the relevant code so we can see what you are doing and how you are doing it.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Do you mean to change to color/background color of the cursor you moving around with your mouse? From JavaScript? Dynamically?
In web pages cursor image can be set by using CSS (possible also via JS, but it is still CSS), by setting the cursor property...
Cursor property supports some predefined values and a URL to an image...
As with most URL related CSS properties this one too can get a data-uri where URL requested...
A data-uri is an inline binary data-string that defines an image, like:
From CSS:
body {
cursor: url('data:application/cur;base64,base64stringoftheimage'), auto;
}
From JS:
document.bodystyle.cursor = "url('data:application/cur;base64,base64stringoftheimage'), auto";
Now you can create that base64-string for your image dynamically based on the color you want...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Hi, thanks for replying. I will attempt to use your solution and see what happens.
|
|
|
|
|
Greetings experts.
Is it possible to take a number like [0 - 999,999,999,999] and convert it into its spoken equivalence using JavaScript?
I have spent almost 30 minutes googling but could not come up with anything.
Thanks for your help in advance
|
|
|
|
|
samflex wrote: Is it possible to take a number like [0 - 999,999,999,999] and convert it into its spoken equivalence using JavaScript? Anything is possible, of course. I would suggest looking for a text-to-speech app that can read web pages, or something along that line.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
You'd need some sort of OS hook (namely a plug-in), or send the selection to a server, that can parse it into a common audio format and send that back.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
google "javascript numbers to words" and you'll find lots of results.
|
|
|
|
|
I have resolved this.
Thanks all
|
|
|
|
|
I want to extract a video name from XML and put it in the URL parameter. I copied the XML reading code from w3school. See below:
var tPath = ... the URL to the XML
var var2 = ... the filename of an XML
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
myFunction(this);
}
};
xmlhttp.open("GET", tPath, true);
xmlhttp.send();
function myFunction(xml) {
var x, xmlDoc, videoName;
xmlDoc = xml.responseXML;
x = xmlDoc.getElementsByTagName("videoName")[0];
videoName = (x.textContent);
alert (videoName);
}
var playerURL = "http://" + getCookie("MediaServerGeneral") + "/IVP/demo.htm?XMLName=" + var2 + "&MediaFileName=" + videoName;
I see the name of the video in alert. but the playerURL has videoName shown as undefined.
my XML is like this, and I'm trying to pick up "videoName.mp4":
<?xml version="1.0" encoding="utf-8" ?>
<video>
<videoName>videoName.mp4</videoName>
<setting>
<videoSize w="896" h="504"></videoSize>
</setting>
</video>
What is wrong with the script?
Thanks,
modified 25-Oct-16 18:02pm.
|
|
|
|
|
|
Just try to fetch the value of "x" in the below code outside "myFunction"
x = xmlDoc.getElementsByTagName("videoName")[0];
I am wondering, if the value of "x" is dying out. I also cant see the closing braces of "myFunction" or no return value of "x" from the function.
Is the below code a part of "myFunction" ?
var x, xmlDoc, videoName;
xmlDoc = xml.responseXML;
x = xmlDoc.getElementsByTagName("videoName")[0];
videoName = (x.textContent);
alert (videoName);
var playerURL = "http://" + getCookie("MediaServerGeneral") + "/IVP/demo.htm?XMLName=" + var2 + "&MediaFileName=" + videoName;
If so, just try out reading the value of the element out side the function and see.
Please let me know the result once.
Thanks
|
|
|
|
|
Thank you for your help. I forgot to copy the } after the alert(videoName). So myFunction ends after alert. var playerURL... is not part of the function.
I'm trying to take the script out of the function. I'll post back the result.
|
|
|
|