SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast epic1231's Avatar
    Join Date
    Sep 2003
    Location
    NJ
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript error's onmouseover

    hey all - i am getting a page error with this javascript code - this is just the basic of it i havn't done it all up yet but for some reason when i check out the page it is giving me an error - does anyone see any reason's why this is happening?

    Thanks in advance,
    Bill

    Code:
    <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="569" id="AutoNumber4" height="157">
        <script language="JavaScript"><!--
    function show(imageSrc) {
        if (document.images) document.images['myImage'].src = imageSrc;
    }
    //--></script>
      <tr>
        <td width="252" height="45">&nbsp;<a href="http://www.weather.com" onMouseover="show('http://www.aaforum.net/limotoday/images/weather.jpg')" onMouseout="show('http://www.aaforum.net/limotoday/images/logo.gif')">Weather</a></td>
    <td rowspan="10" height="157" width="314">
    <p align="center">
    <img src="blank.gif" name="myImage" width="155" height="155"></td></tr>
    <tr><td height="45" width="252"><a href="apage.html" onMouseover="show('image2.gif')" onMouseout="show('blank.gif')">Show Image Two</a></td></tr>
    <tr><td height="46" width="252"><a href="apage.html" onMouseover="show('image3.gif')" onMouseout="show('blank.gif')">Show Image Three</a></td></tr>
    </td>
      </tr>
    </table>
    Last edited by epic1231; Jan 5, 2004 at 14:53.
    Cobra-Games.net -- Facebook Games

  2. #2
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function show(imageSrc) {
    if (document.images) {
    document.images['myImage'].src = imageSrc;
    }
    }


    I think....

  3. #3
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Commenting-out of JavaScript should be done on separate lines:

    <script language="JavaScript">
    <!--
    function show(imageSrc) {
    if (document.images) document.images['myImage'].src = imageSrc;
    }
    //-->
    </script>

    Not a good spot for your JS, anyhow...in between a <table> tag and a <tr>. Stick it in the <head>er of your file; easier to manage and keep an eye on!
    ::: certified wild guess :::


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •