Detect Frame SRC change before loading

P

praskris

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top