J
jon
I would like to use the variable that the javascript creates as it
parses the URL and be able to use this variable in other links on the
same page. notice how link to page 2 has the token but the other links
do not. Can I have one javascript in the heading and then call it up
multiple times in the html to make my links (i.e.
page3.html?refer=google) I have the following webpage.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type"
content="text/html;charset=iso-8859-1">
<title>Untitled Page</title>
<script language="JavaScript">
//<![CDATA[
function parseSearchString()
{
var pairs=unescape(location.search.substring(1).replace(/\+/g,"
")).split('&');
for (var i=0;i<pairs.length;i++){
var pair = pairs.split('=');
this[pair[0]]=pair[1];
}
}
var search = new parseSearchString();
//this will output all the passed variables
for (o in search)
document.write('<a href="page2.html?refer=' + search[o]
+'">Page2</a>');
</script></head>
<body bgcolor="#ffffff">
<p></p>
</body>
</html>
Thanks.
Jon Lanclos
(e-mail address removed)
parses the URL and be able to use this variable in other links on the
same page. notice how link to page 2 has the token but the other links
do not. Can I have one javascript in the heading and then call it up
multiple times in the html to make my links (i.e.
page3.html?refer=google) I have the following webpage.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type"
content="text/html;charset=iso-8859-1">
<title>Untitled Page</title>
<script language="JavaScript">
//<![CDATA[
function parseSearchString()
{
var pairs=unescape(location.search.substring(1).replace(/\+/g,"
")).split('&');
for (var i=0;i<pairs.length;i++){
var pair = pairs.split('=');
this[pair[0]]=pair[1];
}
}
var search = new parseSearchString();
//this will output all the passed variables
for (o in search)
document.write('<a href="page2.html?refer=' + search[o]
+'">Page2</a>');
</script></head>
<body bgcolor="#ffffff">
<p></p>
</body>
</html>
Thanks.
Jon Lanclos
(e-mail address removed)