SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Body Tag Onload Question

    I just added the following code to my head section:

    Code:
    <script type="text/javascript" src="/a1/js/BubbleTooltips.js"></script>
    <script type="text/javascsript">
    window.onload=function(){enableTooltips()};
    </script>
    I discovered that it wasn't working because of my body tag. When I change it to a plain body tag - <body> - it does work.

    But this is what my body tag normally looks like:

    Code:
    <body onload="P7_swapClass(0,'none','showIt','hideIt','div');typeWriter('quote',50);initialize()">
    Can someone show me how to modify my code so that all three scripts work? Also, how would I modify it if I wanted to use the BubbleTooltips script only?

    Thanks.

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't use window.onload and <body onload....
    Use window.onload or <body onload....
    Search the web for details.

  3. #3
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would you please try like this:
    Code:
    <script type="text/javascript" src="/a1/js/BubbleTooltips.js"></script>
    <script type="text/javascsript">
    	function RunAllFunctions(){
    		enableTooltips();
    		P7_swapClass(0,'none','showIt','hideIt','div');
    		typeWriter('quote',50);
    		initialize();
    	}
    	window.onload=function(){RunAllFunctions()};
    </script>
    And of course now you will have only plain body tag.
    Code:
    <body>
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5


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
  •