Detect Frame SRC change before loading

Discussion in 'Javascript' started by praskris@gmail.com, Jun 17, 2006.

  1. Guest

    Hi,

    I am a frameset FRAMES.HTM which has

    -----FRAMES.HTM -- START ----------
    <head>
    <script>
    function myscript()
    {
    var loct = RPFrame.location.href;
    if(loct.indexOf("b.htm") != -1)
    {
    alert("Going to b ");
    window.close();
    }
    }
    </script>
    </head>
    <frameset rows="100%,0" >
    <frame name="RPFrame" src="a.htm" resize="no" scrolling="auto"
    onload="myscript()">
    </frameset>
    -----FRAMES.HTM -- END ----------

    -- A.HTM -- START -----
    <html>
    <body>
    <a href="b.htm"> Go to B </a>
    </body>
    </html>
    -- A.HTM -- END -----

    Basically i am having a html page which is pointing to A.HTM. If the
    URL of the RPFrame is changed to b.htm, i am closing the window. My
    intention is i dont want the user to browser b.htm using my frameset.

    The above code closes the window, but B.HTM is loaded before that as i
    called onload event.

    Is there any other way of detecting the url change of the frame before
    the frame content is being loaded ?

    thanks,
    Guru.
    , Jun 17, 2006
    #1
    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. Steve Richter

    <txt src= ...> equivalent of <img src= ...>

    Steve Richter, Feb 8, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    2,048
    Laurent Bugnion
    Feb 9, 2006
  2. Greg Johnson
    Replies:
    4
    Views:
    3,042
  3. Namshub

    Iframe Src change on form loading

    Namshub, May 30, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    15,344
    Edwin Knoppert
    May 30, 2006
  4. Soren Vejrum
    Replies:
    4
    Views:
    499
    Lasse Reichstein Nielsen
    Jul 5, 2003
  5. ofir
    Replies:
    2
    Views:
    161
Loading...

Share This Page