script for swapping image without onload or <body> tag?

Discussion in 'JavaScript' started by ewhite105, Jun 15, 2005.

  1. #1
    Is there a script out there (which would need to be placed below the <body> tag) that would swap an image without using an onload event or <body> tag?

    notes:
    We have a site where there is a "you are here" image that is swapped depending on the page the user is on. The site is .net framework and the first level of html, that fills in the maincontent area of every page, has a dynamic <body id=""></body> comming from data. Then there are a set of styles attached to show the selected states of btn's and this image swap.

    When the user goes deeper then that first level of html the image switches back to the default image because the <body id=""></body> no longer applies to those deeper pages. Instead of including this modification into the .net framework, we wanted to have that image swap happen spontainiously with a javascript in the html code which has to be a script inside <body></body>
     
    ewhite105, Jun 15, 2005 IP
  2. senexom

    senexom Guest

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    just call your javascript function after your image
    ...
    <img src="myImage" name="imgSwap" />
    <script language="JavaScript"> swapImage(); </script>
     
    senexom, Aug 1, 2005 IP