"Lee" <RE**************@cox.net> wrote in message
news:do*********@drn.newsguy.com...
Mark said:
Hi,
I am trying to open up a new window and then get the current url/location
back from the (win_1) window and display the url in an alert box.
Here is the code I am using :-
<script type="text/javascript">
var mywin_1 = open ("http://www.anysite.com/index.htm", "win_1",
"height=640, width=820, left=200, top=0, scrollbars, status, location");
var temp = mywin_1.location;
alert (temp);
</script>
Where am I going wrong?
4. If you do add a delay, and you do alert the value of location.href, you
will see an error message telling you that you don't have permission
to read the location of a window open on a site that differs from the
site that served the current page. It's a security feature to prevent
people from popping up new windows and then keeping track of where the
user navigates in that window.
Hi,
Thanks for your help on items 1 - 3.
The problem I was having (using Internet Explorer) was that it didnt
acutally display any alert at all (though did say access denied if I
double-click on the '!' on the status bar) obviously I now understand why.
Item #4 - I can understand about the security prevention, but I thought I
would be able to get around this with myself opening the window originally.
There must be some way to get the URL of an open window which the code is
not running in ? Any advice?
The web page in question is for use internally on a standalone machine so I
can lower any 'restrictions' in the actual browser if this needs to be ?
Thanks, Mark