Solved

java script image map problem

Posted on 2000-04-28
2
166 Views
Last Modified: 2010-04-09
when you enter my and the mouse is over the image map that is linked to show text in a form you get an error but when you enter the page and the mouse is not over the image map it loads just fine. how do i fix it, you can view the page at http://209.161.209.101/market/right.htm
0
Comment
Question by:bjbmod
2 Comments
 
LVL 8

Accepted Solution

by:
jbirk earned 75 total points
ID: 2759977
The problem is that the form element you are modifying doesn't exist yet when you rollover it while it's still loading.  This causes an error since it can't find the object.  So you have to set a variable in the onLoad handler for the document.  This will ensure that it is loaded before trying to modify it.

onLoad="loaded=true"

Then in the map areas:
onMouseOver="if (loaded) theForm.out.value='SHOPPING'"

Also be sure to define loaded in the header:
<SCRIPT language="JavaScript">
<!--
var loaded = false;
// -->
</SCRIPT>
</HEAD>

This should fix it for you.
-Josh
0
 

Author Comment

by:bjbmod
ID: 2760224
I am happy, Thank you!
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question