Hey, I've got another issue, although my last one was never worked through... I'm pretty sure this is easy to solve. I've got a little javascript code and I would like to have it be able to fire an onmouseout without defining it explicitly within the HTML tags.
I added in a little code to tell me what the variable itemId was set to when it couldn't locate the object in the page. It came out with the location of the page instead of the variable that I had passed to the function originally (and then again inside a function that calls itself).
The focus is on lines 15 - 31.
-----> Demo
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
<!--
function d2h(d) // Decimal to Hex
{
return d.toString(16);
}
function h2d(h) // Hex to Decimal
{
return parseInt(h,16);
}
function start(itemId)
{
var object = document.getElementById(itemId);
if(!object)
{
document.write("Error, itemId has been set to: "+itemId);
}
if(true) //object.onmouseover)
{
object.innerHTML = "Shiney Link! (Mouse: Over)";
setTimeout("start("+itemId+"); ", (1000));
}
else
{
object.innerHTML = "Shiney Link! (Mouse: Off)";
}
}
function restore(id)
{
// Nothing Yet
}
// -->
</script>
<title>Shiney Link!</title>
</head>
<body>
We are testing the "Shiney Link!" JavaScript program below!<br />
To test it, just simply move your mouse over the link.<br />
In the future we will work on making images, and tables do the same.<br />
<br />
<a href="./" id="shiney" onmouseover="start(this.id); ">Shiney Link! (Mouse: Off)</a>
</body>
</html>[/HTML]