SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist winterheat's Avatar
    Join Date
    Aug 2007
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE6 inherit DOCTYPE Bug? iframe always use parent's Doctype

    I am fixing some bug on IE6. The issue is that the main window is using XHTML 1.0 strict, and an iframe inside of it has the statement

    <a href="javascript:some_function(1)">a link</a>

    and clicking on it will cause almost the whole page to go blank.

    but if I change the line to

    <a href="#" onclick="some_function(1);return false;">a link</a>

    then it won't make almost the whole page go blank.

    I am suspecting that IE6 forces the iframe to also use DOCTYPE of XHTML 1.0 strict, even when the iframe explicitly specifies HTML 4.01 loose.

    If someone knows of this bug, can you confirm it too? Thanks very much!

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    the problem is some_function() is not canceling the default behavior of the link as adding onclick="function();return false" does.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Evangelist winterheat's Avatar
    Join Date
    Aug 2007
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how can some_function() cancel it? I actually tried returning false or returning "haha", and I actually see "haha" or "false" showing up on the page.

    I am so surprised that in

    http://www.0011.com/test/test_pseudo.html

    in IE 6, 7, Firefox 3, click on the link actually change the whole page to "haha", wiping out the whole content. In Google Chrome and Safari, it doesn't.

    Thanks logic_earth.


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
  •