OK here's a couple of things I tried.
HTML
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>delay script</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="txt/javascript">
<script src="locationDelay.js" type="text/javascript">
</script>
</head>
<body>
<span id=dummyspan></span>
<ul >
<li id="xxx">
<a href="http://www.google.com" >
<img src="nextpointer.gif" alt=" " width="65" height="66">
</a>
</li>
</ul>
</body>
</html>
now on that HTML part of it I presently show my ID on the LI tag however I tried it with the ID on the anchor and on the image too an apparently the onclick event is on all three and putting the ID on the anchor tag doesn't help me on the using "this.href" in in my external file. A JavaScript script that works by explicitly scripting the URL is shown below followed by one that doesn't work utilizing the "this.href" like in the embedded example that does work.
Code:
function locationDelay() {
setTimeout(function(){window.location.href="http://www.google.com"},7000);
return false;
};
window.onload = function () {
document.getElementById("xxx").parentNode.onclick=locationDelay;
};
Code:
function locationDelay() {
x=this.href;
setTimeout(function(){window.location.href=x;},7000);
return false;
};
window.onload = function () {
document.getElementById("xxx").parentNode.onclick=locationDelay;
};
when I move my ID to the anchor tag I also remove the "parentnode" between "document.getElementById("xxx")" and the rest of that line. But that doesn't work either. The reason I have my ID on the LI tag is I am modeling the way I haven't on these 27 pages this script is intended for. The reason for the short delay is to give a very short and low volume clicking sound time to sound. Most browsers have a conflict if you start a sound in one location and immediately go to another. I know I've been told this sound may not be a good idea but I intend to ask on a design forum once my implication of this idea is working even know it's against some kind of golden rule. So that's it any help you could give me would be greatly appreciated.
Sincerely
Marc
Bookmarks