SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Ie6 Bug ?

  1. #1
    SitePoint Enthusiast minus's Avatar
    Join Date
    Jan 2002
    Location
    Pittsburgh, PA, USA
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Ie6 Bug ?

    Hello,

    I would like to draw your attention on what seems to me to be a bug in IE6.

    It regards the call of a function from a popup. Say a link on page.html allows you to open popup.html ; popup.html contains a link that can trigger javascript functions in page.html. If you want to refresh page.html from popup.html, using the classical "location.reload()" inside a function DOESN'T WORK. I get the following javascript error: "Variable uses an Automation type not supported in JScript".

    The following code doesn't work:

    page.html
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    
    <head>
    	<title>Untitled</title>
    </head>
    <script language="JavaScript">
    function reloadIt() {
    	location.reload();
    }
    </script>
    <body>
    <a href="javascript://" onclick="window.open('popup.html','popup','width=200,height=200')">Open the popup</a>
    </body>
    </html>
    popup.html
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    	<title>Untitled</title>
    </head>
    <script language="JavaScript">
    function clicky() {
    	window.opener.reloadIt();
    	window.close();
    }
    </script>
    
    <body>
    <a href="javascript://" onclick="clicky()">Refresh the parent</a>
    
    
    </body>
    </html>
    This does of course work with IE5, IE5.5, Mozilla and NN6.

    The following doesn't work either:
    "window.location.href = window.location.href;"
    "document.location.reload();"

    (still, all that works with Mozilla)

    FIX: use history.go(). The following does work:

    Code:
    <script language="JavaScript">
    function reloadIt() {
    	window.history.go(0);
    }
    </script>
    That would have saved me a lot of time...

    Anyways, if anyone can explain to me what went wrong, please do so; otherwise, well, have a nice one!

  2. #2
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    If history.go() works, then it is likely self.location.href=self.location.href; would also work.

    Is reload() a valid method of location? Some documentation would be good, as it would seem that this is the issue, as opposed to MS simply not totally supporting JS (which seems ludicrous on the surface, but you never know)
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  3. #3
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Works in IE 6.0.2600 / Win2000

  4. #4
    SitePoint Enthusiast minus's Avatar
    Join Date
    Jan 2002
    Location
    Pittsburgh, PA, USA
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is weird: I use the same config but the "self.location.href=self.location.href" doesn't work with me... Jofa, what were you referring to? Jeremy's stuff or mine?

    Support for both reload() and replace() methods were added to location in Javascript 1.1.


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
  •