Domain Access denied for window.open request

W

Wang, Jay

I try to open up a window with window.open in javascript. "domain.html"
contains domain information 'domain.school.edu'. The "Access denied" problem
happens when document.write is trying to put variable s into the new window.
Sometimes, it writes successfully, while other times the popup error is
"access denied". How to solve this problem? thanks

____________________________

function setup(){
var w =
window.open("domain.html","Print","menubar=yes,toolbar=no,scrollbars=yes,status=no,resizable=yes");
w.document.domain = 'domain.school.edu';
var message = SVGDoc.getElementById("rangeplot") ? "drawrange" : "";
var hd = crawl_down(1, document.documentElement, function(o){return
o.tagName=="HEAD"});
// alert('Plot window is opened');
var s = "<html>"+hd.outerHTML;
s +="<body onload='printing_only(event)'>";
s +=document.getElementById("plotmenustyle").outerHTML;
s +="<div id='demor'
style='margin-top:10;margin-left:100'>"+pat_info()+"</div><div id='msg'
msg='"+message+"'></div>"+ftplt.outerHTML+"</body></html>";

w.document.write(s);
w.location.reload(false); //necessary to trigger onload event
}
 
M

Martin Honnen

w.document.write(s);
w.location.reload(false); //necessary to trigger onload event

Not really, I am sure if you properly call
w.document.open();
w.document.write(s);
w.document.close();
then the load event is fired, no need to call reload.
 
W

Wang, Jay

Martin Honnen said:
Not really, I am sure if you properly call
w.document.open();
w.document.write(s);
w.document.close();
then the load event is fired, no need to call reload.

reload setting to false is needed for my program to make onload event work.
Even after I commented that line out, the access denied error still shows
up.

thanks.

Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top