开发者

How to get the url from a frame?

开发者 https://www.devze.com 2023-03-28 01:42 出处:网络
I have this jsp page that includes the following frames: <frameset cols=\"20%,*\"> <frame src=”SideBar.jsp” name=\"frameA\">

I have this jsp page that includes the following frames:

<frameset cols="20%,*">
    <frame src=”SideBar.jsp” name="frameA">
    <frame src=”http://www.w3schools.com/” name="frameB" target="_self">
</frameset>

In frameB,it's an external link, the user can navigate that webpage and click on links and do stuff. Is there a way when the user clicks on a link, to get the url of that new webpage? e.g. h开发者_高级运维ttp://www.w3schools.com/html/default.asp

Thanks in advance


Did you try:

alert(frameB.location);

Depending on the browser, this may be disabled due to security reasons.

(You don't know when the user clicked a page, so you should check in regular intervals if it changed.)

0

精彩评论

暂无评论...
验证码 换一张
取 消