Forum Moderators: open
code:
<script>
if (parent.opener.location) {
parent.opener.location = "http://domain.com/";
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);
}
</script>
How would I go about stopping this from taking effect? Any nullifying code I can use to disallow Javascript redirecting?
Currently they are doing this without my permission, but if I can stop it I won't mind.
When I open a new window instead of a tab, it does not happen to the starting page in either browser.
Help here would be greatly appreciated.
Thank's for the advice
parent.opener.location
If a window does not have a parent then it's parent property is going to be a reference to itself. Not much you can do here.
parent.opener.location
When a window is opened from another window it maintains a reference to that first window in the
openerproperty of the DOM
windowobject. If the current window has no opener, the opener method returns NULL.
parent.opener.location
Returns a Location object which contains information about the URL of the document. However, if the opener was NULL, then this is going to obviously return a false value to the if statement in the corresponding JavaScript you provided.
I would probably focus on that "opener" property.
<added>
I was going to ask if you were using target="_blank" ;)
[webmasterworld.com...]
</added>