JS: Why doesn't doc.write of onMouseOver work?

by Complex <complex_hwg(at)yahoo.com>

 Date:  Thu, 9 Nov 2000 17:06:16 -0800 (PST)
 To:  hwg-languages(at)hwg.org
  todo: View Thread, Original
Please help me solve this simple problem.

I am trying to use document.write to present a linked image with a
mouseover. It seemed simple enough.

The page http://www.scanalytics.com/webtest/test3.html (test page on
corporate site) should contain three images: 
1) a linked image generated via doc.write, without a mouseover.
2) the same thing but with a mouseover (a message appears in the status
bar at the bottom of your window),
3)  a linked image generated via normal HTML, with the same mouseover.

In Netscape 4.76 and IE 5, both for Mac, the second image does not
appear. Cutting out the onMouseOver code makes this image appear!
Leaving it in makes the entire <script> statement fail! (If I put both
the first and the second document.writes into a single <script>
statement, neither would appear.)

Why does onMouseOver kill this script? Am I doing it wrong, or what?

Here's the text of the scripts. I'll insert spaces before the <'s in
case some email reader tries to render it. (Is that normally a
problem?)

< script language="javascript">
< !--
document.write("<a href='http://www.scanalytics.com'><img
src='http://www.scanalytics.com/images/tslogo3_web.gif'></a>");
//-->
< /script>

< p>The linked image WITH a status bar message should be here: (if so,
put your mouse over it)</p>
< script language="javascript">
< !--
document.write("< a href='http://www.scanalytics.com'
onMouseOver='window.status="Go to Scanalytics Home Page"; return
true;'>< img src='http://www.scanalytics.com/images/tslogo3_web.gif'><
/a>");
//-->
< /script>

				Thank you

=====
Michael Greisman
Webmaster
Scanalytics, Inc.

__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one Place.
http://shopping.yahoo.com/

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA