I get two frames, says A and B. Clicking a link in A will trigger page in B changing from URL_A to URL_B.
How do I remember URL_A, so that when users click cancel button in URL_B, they can go back to URL_A?
how do I get mainFrame's URL in fraTopMenu?
<frameset rows="60,*" cols="*" frameborder="no" border="0" framespacing="0">
<frame src="/Common/Manager/TopMenu.aspx" name="fraTopMenu"
scrolling="no" noresize="noresize" id="fraTopMenu" title="" />
<frameset rows="*" cols="185,*" framespacing="0" frameborder="no" border="0">
<frame src="/Common/Manager/LeftMenu.aspx" name="leftFrame" id="leftFrame"
title="" /> 开发者_C百科
<frame src="<%= MainUrl %>" name="mainFrame" id="mainFrame" />
</frameset>
</frameset>
Clicking a link in frame A will cause frame B's URL to change to URL_B from URL_A
Change the frame B's URL to URL_B?back_url=URL_A
instead. Now you can read URL_A from the document.location.search.split[1]
You can get the frame's url using top.frames[2].window.location.href
The Http Referer might be your best bet. It is (at best) an unreliable mechanism to use as it is sent from the browser and is just as often blank.
精彩评论