Results 1 to 3 of 3

Thread: Cool DHTML Tooltip II

  1. #1
    Join Date
    Apr 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Cool DHTML Tooltip II

    Hello, first time poster here!

    I am wanting to use the Cool DHTML Tooltip II for a new project in PHP I am working on. However, there is an issue I have come acrossed, is there any way to get this to work in FireFox?

    Nevermind, I fixed it. However, why does it ONLY work IF you place the script code below the <body> tag of the HTML? I had the script in a tooltip.js and it worked perfect in IE, Netscape and Opera! Can someone shed some light on this?

    Gandalf
    Last edited by Gandalf; 04-15-2005 at 01:23 AM.

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Gandalf
    [W]hy does it ONLY work IF you place the script code below the <body> tag of the HTML?
    It should only work if the script element is placed after the tool-tip container. That would have to be after the body start tag in any case, unless you have some very badly written HTML.

    The other reason (though the first one is enough) is that the script tries to access either the body or html element, depending on whether your document induces Quirks mode or Standards mode. If the user agent hasn't parsed the body, it won't exist within the document tree, so it's impossible to obtain a reference to it. As a result, the script would fail with a "Object has no properties"-like error.

    Mike

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Just to add to what Mike said - as we go forward in time, we will probably find more and more browsers demanding this sort of logic in page code layout.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •