J
johkar
I am getting an Access denied error when I write to a new window. The
situation and code are outlined below. I am setting the domain in the
main window. The problem is that the window I am popping up never gets
it domain set, even though I have coded it to be the same as the main
window. I get an Access Denied errror.
Four different domains:
*localhost.mycompany.com
*test.mycompany.com
*pilot.mycompany.com
*mycompany.com
Page 1 on localhost.mycompany.com has its domain set via script:
document.domain="mycompany.com"; This is the main window
Page 2 - Written to the popup window below also is also set to the same
domain. Upon submit, Page to calls page 3 which is name lookup
servlet. Page 3 returns the value to Page 1 (main window).
<script type="text/javascript">
winstr += '<html><head><title>my App<\/title>';
winstr += '<script
type="text\/javascript">document.domain=\'mycompany.com\'<\/script>';
winstr += '<\/head>';
winstr += '<body>';
winstr += '<form name="myForm" method="get" action="default.do">';
winstr += '<div class="textbold">Last Name:<\/div>';
winstr += '<input type="text" name="searchFilter" id="searchFilter"
size="26" \/>';
winstr += '<input type="submit" value="Search" \/><\/div>';
winstr += '<\/form>';
winstr += '<\/body>';
winstr += '<\/html>';
var w=220;
var h=120;
var winname='popWindow';
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
var winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl +
',toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no';
if(win==null || win.closed)//only launch window if it doesn't already
exist
win = window.open("", winname, winprops);
win.focus();
windoc = win.document;
//win.document.domain='mycompany.com';
windoc.write(winstr);
windoc.close();
</script>
situation and code are outlined below. I am setting the domain in the
main window. The problem is that the window I am popping up never gets
it domain set, even though I have coded it to be the same as the main
window. I get an Access Denied errror.
Four different domains:
*localhost.mycompany.com
*test.mycompany.com
*pilot.mycompany.com
*mycompany.com
Page 1 on localhost.mycompany.com has its domain set via script:
document.domain="mycompany.com"; This is the main window
Page 2 - Written to the popup window below also is also set to the same
domain. Upon submit, Page to calls page 3 which is name lookup
servlet. Page 3 returns the value to Page 1 (main window).
<script type="text/javascript">
winstr += '<html><head><title>my App<\/title>';
winstr += '<script
type="text\/javascript">document.domain=\'mycompany.com\'<\/script>';
winstr += '<\/head>';
winstr += '<body>';
winstr += '<form name="myForm" method="get" action="default.do">';
winstr += '<div class="textbold">Last Name:<\/div>';
winstr += '<input type="text" name="searchFilter" id="searchFilter"
size="26" \/>';
winstr += '<input type="submit" value="Search" \/><\/div>';
winstr += '<\/form>';
winstr += '<\/body>';
winstr += '<\/html>';
var w=220;
var h=120;
var winname='popWindow';
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
var winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl +
',toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no';
if(win==null || win.closed)//only launch window if it doesn't already
exist
win = window.open("", winname, winprops);
win.focus();
windoc = win.document;
//win.document.domain='mycompany.com';
windoc.write(winstr);
windoc.close();
</script>