Domain Access denied for window.open request

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wang, Jay

    #1

    Domain Access denied for window.open request

    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
    }


  • Martin Honnen

    #2
    Re: Domain Access denied for window.open request



    Wang, Jay wrote:
    [color=blue]
    > w.document.writ e(s);
    > w.location.relo ad(false); //necessary to trigger onload event[/color]

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



    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • Wang, Jay

      #3
      Re: Domain Access denied for window.open request


      "Martin Honnen" <mahotrash@yaho o.de> wrote in message
      news:41dd75a6$0 $23130$9b4e6d93 @newsread2.arco r-online.net...[color=blue]
      >
      >
      > Wang, Jay wrote:
      >[color=green]
      >> w.document.writ e(s);
      >> w.location.relo ad(false); //necessary to trigger onload event[/color]
      >
      > Not really, I am sure if you properly call
      > w.document.open ();
      > w.document.writ e(s);
      > w.document.clos e();
      > then the load event is fired, no need to call reload.[/color]

      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


      Comment

      Working...