PDA

View Full Version : Problem in events


vnmshenoy
02-07-2008, 10:54 AM
<html>
<head>
<script type="text/javascript">
function mouseOver()
{alert("hhihihi");
document.b1.src ="D:\all1010\Leo8.gif";
}
function mouseOut()
{alert("bye");

document.b1.src ="C:\IBMTOOLS\APPS\IBMRNR\Note2.GIF";
}
</script>
</head>

<body>
<a href="http://www.hifi.com" target="_blank">
<img border="0" src="C:\IBMTOOLS\APPS\IBMRNR\Note2.GIF" name="b1" width="26" height="26" onmouseover="mouseOver()" onmouseout="mouseOut()" /></a>
</body>
</html>


Above is the code .Here there are two events about which i need to know.
1) mouseover and 2)mouse out.
I know what these events means ........
Paths to both the gif images are absoultely correct....iam sure...
When i open this page for the first time, i am infact able to see the image i.e Note2.GIF.
Then i take the mouse over the image , therefore MOUSEOVER event occurs.
It calls the MOUSEOVER method in my page and therefore displays alert message i.e hihihi
But the new image doesnot get loaded. (i.e iam not able to see
Leo8.gif).Infact no image is displayed now(even Note2.GIF is disappeared...)
Similarly when i take the mouse out from image , i get alert message as "bye",
but now also nothing is displayed....
I want to know how to solve it....

abduraooft
02-07-2008, 12:28 PM
All addresses like C:\.... are used by windows machine, but the addressing system in web is different. It uses forward slashes(/) to seperate folders. To make it sure, open your page in FF(I believe there won't be an image displayed)

Now to make your work easy, use the relative path of images to that of your html page. Say store all picturess in a folder named images and keep it in the same directory where your html file resides. Then you can access them by images/picture1.gif, images/picture2.gif etc.