Redirect problem in IE

Discussion in 'Javascript' started by Van Duijn, Nov 4, 2005.

  1. Van Duijn

    Van Duijn Guest

    I use an inlineframe to display pages with images with javascript pop up
    links. These image pages redirect to each other with the trusted <meta
    http-equiv="refresh" content="10; url=vb9.htm"> metatag.

    Now this works perfectly well in Netscape and Firefox, but Internet Explorer
    is spoling the fun. After you click an image to open the popup box, the
    image pages (in the inlineframe) won't refresh anymore. As long as you don't
    click an image, there's nothing wrong.
    Now, I've tried another popup script, but the effect was the same - so the
    pop up is not the problem.

    I also tried a different redirect script:

    <SCRIPT LANGUAGE="JavaScript">
    <!-- begin hiding JavaScript from old browsers
    // define redirect function
    // change redirect2.htm to required destination
    function redirect(){
    parent.location.href="vb9.htm"
    }
    // End hiding JavaScript -->
    </SCRIPT>

    .... but this one does not open the new page in the inlineframe, but on top.

    Any suggestions as how to make this work?

    Martin van Duijn -
    Van Duijn, Nov 4, 2005
    #1
    1. Advertising

  2. Van Duijn wrote:
    > I use an inlineframe to display pages with images with
    > javascript pop up links. These image pages redirect to
    > each other with the trusted
    > <meta http-equiv="refresh" content="10; url=vb9.htm">
    > metatag.


    IE->Tools->Internet Options... ->Security ->[select
    zone->(Internet)]->Custom Level... ->Micellanious -> Allow META
    REFRESH -> Disable/Enable

    Trusting something that can be switched off independently of scripting
    is not a good plan.

    > ..., but Internet Explorer is spoling the fun. After
    > you click an image to open the popup box, the image
    > pages (in the inlineframe) won't refresh anymore. As
    > long as you don't click an image, there's nothing wrong.


    So on Internet Explorer (only) the act of clicking something suddenly
    renders the browser partly non-functional? You haven't, by any chance,
    wrapped your image in:-

    <A href="javascript:something();"><IMG ... ></A>

    -?

    > Now, I've tried another popup script, but the effect
    > was the same - so the pop up is not the problem.
    >
    > I also tried a different redirect script:
    >
    > <SCRIPT LANGUAGE="JavaScript">
    > <!-- begin hiding JavaScript from old browsers
    > // define redirect function
    > // change redirect2.htm to required destination
    > function redirect(){
    > parent.location.href="vb9.htm"

    ^^^^^^
    > }
    > // End hiding JavaScript -->
    > </SCRIPT>
    >
    > ... but this one does not open the new page in the
    > inlineframe, but on top.


    The - parent - of a frame is the window that contains the frame. You are
    asking the browser to load the page in the parent and it is doing so.
    Replace - parent - with - window - and it probably will work better.

    Richard.
    Richard Cornford, Nov 4, 2005
    #2
    1. Advertising

  3. Van Duijn

    Van Duijn Guest

    Thanks! It works fine now. Just can't believe I did not see that I should
    have changed "parent" to "window".

    "Richard Cornford" <> schreef in bericht
    news:dkg82b$q2r$1$...
    > >
    > > I also tried a different redirect script:
    > >
    > > <SCRIPT LANGUAGE="JavaScript">
    > > <!-- begin hiding JavaScript from old browsers
    > > // define redirect function
    > > // change redirect2.htm to required destination
    > > function redirect(){
    > > parent.location.href="vb9.htm"

    > ^^^^^^
    > > }
    > > // End hiding JavaScript -->
    > > </SCRIPT>
    > >
    > > ... but this one does not open the new page in the
    > > inlineframe, but on top.

    >
    > The - parent - of a frame is the window that contains the frame. You are
    > asking the browser to load the page in the parent and it is doing so.
    > Replace - parent - with - window - and it probably will work better.
    >
    > Richard.
    >
    >
    Van Duijn, Nov 7, 2005
    #3
  4. Thanks! It works fine now. Just can't believe I did not see that I
    should have changed "parent" to "window".



    *** Sent via Developersdex http://www.developersdex.com ***
    Martin van Duijn, Nov 7, 2005
    #4
  5. Van Duijn wrote:
    > Thanks! It works fine now. Just can't believe I did not
    > see that I should have changed "parent" to "window".


    Fair enough. It would have been nice to have an answer to my question
    about whether you were using a link with a javascript pseudo-protocol
    HREF around the image. I don't need the answer myself as I already know
    that you were (the diagnosis from the symptoms is sufficient in this
    case). But there are those who would prefer to dismiss IE's many
    problems with javascript pseudo-protocol HREFs and it would have been
    good to bring yet another example to their attention.

    > Richard Cornford schreef:

    <snip>

    Please don't top-post to comp.lang.javascript, you will find it counter
    productive in the long run (though may not actually observe the
    consequences).

    Richard.
    Richard Cornford, Nov 13, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bagsmode
    Replies:
    2
    Views:
    5,466
    bagsmode
    Jul 28, 2003
  2. Jay
    Replies:
    2
    Views:
    336
    Hermit Dave
    Jan 26, 2004
  3. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,213
    Srowe1975
    Oct 15, 2008
  4. Sal
    Replies:
    1
    Views:
    370
  5. Ron Howard
    Replies:
    2
    Views:
    503
    Ron Howard
    Aug 11, 2004
Loading...

Share This Page