PDA

View Full Version : Code works in Firefox and not in IE8, Why?



russco32
Mar 5th, 2012, 12:31 PM
I've coded a Web page to produce a PopUp window to display a Larger copy of a graphic when a "Hot Spot" is clicked.
It works in Firefox but not in IE8.
Can someone tell me what I've done wrong?

The site is www.mountainsideholdings.com/FAT/Page-2.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=iso-8859-1" />
<title>FAT Race products</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=500,left = 0,top = 300');");
}
// End -->
<!-- Begin
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</head>

<body>
<div>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 width=900 NOF=LY>
<TR VALIGN=TOP ALIGN=center>
<TD >
<img src="Page 02.jpg" width=80% border="0" usemap="#Map3">
</TD>
</TR>
</TABLE>
</div>

<map name="Map3" id="Map3">
<area shape="rect" coords="33,363,144,393" href="http://mountainsideholdings.com/FAT/Page-1.html" />
<area shape="rect" coords="33,425,144,455" href="mailto:[email protected]" />
<area shape="rect" coords="182,141,255,222" value="Open the Popup Window"
onMouseOver="javascript:popUp('http://mountainsideholdings.com/FAT/Hammer 1.jpg')">
</map>
</body>
</html>

webdev1958
Mar 5th, 2012, 12:44 PM
the w3c validator spits out 35 errors for the url you posted. Fix those first.

sunfighter
Mar 5th, 2012, 04:44 PM
Dont use spaces:
<img src="Page 02.jpg"

russco32
Mar 7th, 2012, 03:11 AM
Thanks for the advise. I wasn't aware of a Validation program.
I've corrected all errors, but the problem still remains.
When I click the "Hot Link" in Firefox the Popup appears with the graphic.
When I click the "Hot Link" in IE8, I get the Popup but no Graphic.
The problem appears to be in Line 37.

It's driving me crazy

Can you help?
Thanks in anticipation.

The site is www.mountainsideholdings.com/FAT/Page-2.html

[Code]
<!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=iso-8859-1" />
<title>FAT Race products</title>
<script language="JavaScript" type="text/javascript">
<!-- Begin
function popitup(url) {
newwindow=window.open(url,'name','height=600,width=600');
if (window.focus) {newwindow.focus()}
return false;
}
// End -->
<!-- Begin
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</head>

<body>
<div>
<table width="900">
<tr valign="top" align="center">
<td >
<img src="Page02.jpg" alt="Page2" width="800" border="0" usemap="#Map3"/> </td>
</tr>
</table>
</div>

<map name="Map3" id="Map3">
<area shape="rect" coords="45,473,156,503" href="mailto:[email protected]" alt="email" />
<area shape="rect" coords="46,406,157,436" href="http://www.mountainsideholdings.com/FAT/Page-1.html" alt="Page-1" />
<area shape="rect" coords="199,154,287,248" onclick="return popitup('http://www.mountainsideholdings.com/FAT/Hammer1.jpg')" alt="Graphic1" />

</map>
</body>
</html>
[Code]

telekovar
Mar 7th, 2012, 04:47 AM
I tried your link on Chrome, IE8, Firefox, and Safari... I encountered no problems with any of them. Clear your browser history/ cookies and try again maybe?

russco32
Mar 7th, 2012, 06:57 AM
Thanks telekovar.
Wow! I'm glad I'm not going nuts.

I cleared the History etc. but the problem's still there so it looks like it's my machine.
I'm actually using IE9. A Google search reveals other IE9 users are having the odd problem as well. So, I'll look into that.

Has anyone got any other suggestions?

Russ

sean3838
Mar 7th, 2012, 07:04 AM
What is this site for? Your business? Just curious sorry to go off-topic.

telekovar
Mar 10th, 2012, 11:52 AM
Thanks telekovar.
Wow! I'm glad I'm not going nuts.

I cleared the History etc. but the problem's still there so it looks like it's my machine.
I'm actually using IE9. A Google search reveals other IE9 users are having the odd problem as well. So, I'll look into that.

Has anyone got any other suggestions?

Russ

Try this stripped down code. If it works, the image-map is your problem (kinda doubtful but worth a shot). Also, maybe try removing the preload part of the script...



<html>
<head>
<script language="JavaScript" type="text/javascript">
<!-- Begin
function popitup(url) {
newwindow=window.open(url,'name','height=600,width=600');
if (window.focus) {newwindow.focus()}
return false;
}
// End -->
<!-- Begin
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</head>
<body>
<br /><br />
<a href="#" onclick="popitup('http://www.mountainsideholdings.com/FAT/Hammer1.jpg')">Make Popup</a>

</body>
</html>