I found some code to open a link in a new window, and then change the current window to something new as well. This works fine in Firefox, but testing it in IE8 doesn't work.

<SCRIPT type="text/javascript">
function poptastic(url)
{
        newwin=window.open(url,'name','top=0,left=0,resizable=1,scrollbars=1');
        newwin.moveTo(0,0);
        newwin.resizeTo(newwin.screen.availWidth, newwin.screen.availHeight);
        if (window.focus) {newwin.focus()}
        window.location = "thankyou.php";

}
</script>

and for the link:

<input id="submit1" name="submit1" type="button" onClick="javascript:poptastic('http://www.google.com');" value="Continue" /></div>

In IE8 it doesn't change the old window, the new window doesn't open full screen, and it shows an error: Access is denied.

However if I change the url to a local page like:

<input id="submit1" name="submit1" type="button" onClick="javascript:poptastic('newwindow.php');" value="Continue" /></div>

it works fine. It's only when specifying a page outside my domain it causes problems. Any ideas?

Recommended Answers

All 2 Replies

You are not supposed to access other domain because of security issue. This is just prevent you from hacking/attacking other site on purpose (doesn't mean it is a guarantee but for most of it).

Is there anything I can set to allow this, as I own both domains?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.