June 11th, 2000, 07:54 AM
-
Hi everybody,
the following code does not work with Netscape 4.x:
<map name="startMap">
<area onClick="show1();" shape="rect" alt="show1" coords="680,2,760,30">
<area onClick="show2();" shape="rect" alt="show1" coords="220,2,300,30">
</map>
<img src="../gfx/pb_start.jpg" usemap="#startMap" alt="press Start">
When clicking on the specified area of the image, nothing happens. With IE5 though it works perfectly. Does anybody have a suggestion for that ?
Thanks a lot !
Andreas
June 11th, 2000, 02:59 PM
-
If you put your mouse on the image map and the hotspots are where you want them then the problem will be in the script. I cannot help any further without seeing the script where your show1() and show2() functions are defined.
Spookster
June 11th, 2000, 05:37 PM
-
Hi Spookster,
thanks for helping me. Here's the script.
Show1 should test for the existance of nw and if nw does not exist, it should open a new window. (By the way, this does not work both with IE and Netscape).
Show2 works on IE5 but not on Netscape. With Netscape nothing happens at all !.
My guess is that I need to change my code where I try for the existance of nw (if(!document.nw)).
Probably Netscape stops processing Javascript after an error occured whereas IE continues. I am not sure but this could be the solution, what do you think?
Andreas
<SCRIPT LANGUAGE="JavaScript">
<!--
// submit form, open new window and show newspaper
function show1()
{
document.newsJob.action='newspaper_frame.php';
//document.newsJob.action='test_news.php';
if(!(document.nw))
{
nw = window.open("","newsWindow","width=800,height=700,scrollbars=yes,resizable=yes,status=yes,location=y es,toolbar=yes");
}
document.newsJob.target='newsWindow';
document.newsJob.submit();
document.nw.focus();
return true;
}
// submit form, open new window and show job list
function show2()
{
document.newsJob.action='job_list_frame.php';
//document.newsJob.action='test.php';
document.newsJob.target='_top';
document.newsJob.submit();
return true;
}
-->
</SCRIPT>
June 12th, 2000, 02:45 AM
-
I would try using the window.closed property instead.
if(!nw.closed){
do this if window is open
}
else{
do this if window is closed
}
Spookster
June 13th, 2000, 01:11 AM
-
When running the script through my syntax/web browser compatibility checker, the only error I received was in your closing comment line. Change the --> to //--> at the end of your script.
Russ