Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing vars from frames to new window only half working.

Status
Not open for further replies.

catfishdesign

Programmer
Jul 3, 2001
2
CA
I have managed to get the HREF of the frame "MAIN_FRAME" to my mail1.asp page in a new window OK. :)
BUT if the contents of frame "MAIN_FRAME" is from outside my site then the HREF variable does not work. :-(
Here is my code....

===============================================================
<script LANGUAGE=&quot;JavaScript&quot;>

function geturl(x) {
var undefined
var test
test = top.frames[&quot;main&quot;].frames[&quot;MAIN_FRAME&quot;];
main = top.frames[&quot;main&quot;].location.href;
if (test==undefined)
{MAIN_FRAME = main;}
else {MAIN_FRAME = top.frames[&quot;main&quot;].frames[&quot;MAIN_FRAME&quot;].location.href;} **** ERROR HERE if out of site page ****
loc = &quot;mail/mail&quot; + x + &quot;.asp?main=&quot; + main + &quot;&frame=&quot; + MAIN_FRAME;
window.open(loc);
}

</script>
===============================================================

Is there an &quot;onerror&quot; event I can use? I have tried &quot;window.onerror&quot; but it still does not work.
Can I do this better in ASP code rather than javascript?

The &quot;out of site&quot; page returns a &quot;Permission Error&quot; / &quot;Anonymous Routine&quot; when I try to assign that variable.

Someone please help me out or point me to the help I need.
 
I don't think this is possible as it allows any webpage to find out what other websites the clients browser has been to and this is disallowed by the browser
 
If I can flag the error adn not use the &quot;external&quot; URL and continue to my mail.asp page then that would be fine. ANY IDEAS ANYONE ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top