I've been having a few problems getting a Javascript Redirection system setup. Basically, what i'm trying to do is modify all my site's external links to send a querystring to a disclaimer page containing the requested URL.
I'm not sure what I've messed up, but whenever I open the page in browser I get a blank page. Could it be the forward slashes or single quotes causing this? Or would it be the script in the header (document.location.href = "disclaimer.html?"url... or a combination of the above???
Any help would be most appreciated.
Thanks!!
Code for referrer page...
Code for disclaimer page (not built yet, but this is the logic)
I'm not sure what I've messed up, but whenever I open the page in browser I get a blank page. Could it be the forward slashes or single quotes causing this? Or would it be the script in the header (document.location.href = "disclaimer.html?"url... or a combination of the above???
Any help would be most appreciated.
Thanks!!
Code for referrer page...
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Enfield website: content page with link</title>
<script language="javascript" type="text/javascript">
function redirect(url) {
document.location.href = "disclaimer.html?"url;
}
</script>
</head>
<body>
<script language="javascript" type="text/javascript">
<!--
document.write(' <a href="#" onclick="redirect('[URL unfurl="true"]http://www.ninemsn.com.au')">External[/URL] site link JS - Ninemsn</a> ');
//-->
</script>
<noscript>
<a href="[URL unfurl="true"]http://www.google.com"[/URL] target="_blank">External site link - Google</a>
</noscript>
</body>
</html>
Code for disclaimer page (not built yet, but this is the logic)
Code:
1. Save querystring as variable querystring = querystringFromURL
2. Start timer - 5 second delay
3. Insert querystring into javascript redirect:
document.location.href = querystring;