I try to open up a window with window.open in javascript. "domain.htm l"
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("do main.html","Pri nt","menubar=ye s,toolbar=no,sc rollbars=yes,st atus=no,resizab le=yes");
w.document.doma in = 'domain.school. edu';
var message = SVGDoc.getEleme ntById("rangepl ot") ? "drawrange" : "";
var hd = crawl_down(1, document.docume ntElement, function(o){ret urn
o.tagName=="HEA D"});
// alert('Plot window is opened');
var s = "<html>"+hd.out erHTML;
s +="<body onload='printin g_only(event)'> ";
s +=document.getE lementById("plo tmenustyle").ou terHTML;
s +="<div id='demor'
style='margin-top:10;margin-left:100'>"+pat _info()+"</div><div id='msg'
msg='"+message+ "'></div>"+ftplt.out erHTML+"</body></html>";
w.document.writ e(s);
w.location.relo ad(false); //necessary to trigger onload event
}
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("do main.html","Pri nt","menubar=ye s,toolbar=no,sc rollbars=yes,st atus=no,resizab le=yes");
w.document.doma in = 'domain.school. edu';
var message = SVGDoc.getEleme ntById("rangepl ot") ? "drawrange" : "";
var hd = crawl_down(1, document.docume ntElement, function(o){ret urn
o.tagName=="HEA D"});
// alert('Plot window is opened');
var s = "<html>"+hd.out erHTML;
s +="<body onload='printin g_only(event)'> ";
s +=document.getE lementById("plo tmenustyle").ou terHTML;
s +="<div id='demor'
style='margin-top:10;margin-left:100'>"+pat _info()+"</div><div id='msg'
msg='"+message+ "'></div>"+ftplt.out erHTML+"</body></html>";
w.document.writ e(s);
w.location.relo ad(false); //necessary to trigger onload event
}
Comment