I’ve just begun writing in JavaScript. The code below should allow me to pass the cursor over the pink button, turn the pink button to a gray one, then send me to the new web page when I click on the button. I am testing the code on my XP system before going online, so all the file locations are local – I have checked them thoroughly. JavaScript is enabled. When I double click on the button jpgs in Windows Explorer, each image appears correctly, so I know they are in the right location and function properly.
Working: The pink button does appear when I first open the page. The link to the next page does work when I click on the pink button.
Not working: When I roll the cursor over the button, the pink button disappears and the gray button does not appear.
What am I missing here – can anybody help me? I appreciate your time. Thanks in advance.
<html>
<head>
<SCRIPT language=”javascript”>
<!–
// Preload universal images:
b0off = new Image();
b0off.src = “e:NBSCC_DataWebGray_Button_Basic1.jpg”;
b0on = new Image();
b0on.src = “e:NBSCC_DataWebPink_Button_Basic1.jpg”;
function hiLite(imgDocID,imgObjName) {
document.images[imgDocID].src = imgObjName;
}
function hiLiteOff(imgDocID,imgObjName) {
document.images[imgDocID].src = imgObjName;
}
//–>
</SCRIPT>
</head>
<body>
<DIV>
<A href=”e:NBSCC_DataWebNbscc_Aesthetician.htm”
onmouseover=”hiLite(‘b0′,’e:NBSCC_DataWebGray_Button_Basic1.jpg’)”
onmouseout=”hiLiteOff(‘b0′,’e:NBSCC_DataWebPink_Button_Basic1.jpg’)”>
<IMG src=”e:NBSCC_DataWebPink_Button_Basic1.jpg” name=”b0″ width=”77″ height=”21″ border=”0″ alt=”Aesthetician Bio”></A>
</DIV>
</body>
</html>