Loading ...
Sorry, an error occurred while loading the content.

Permission denied to call method XMLHttpRequest.open

Expand Messages
  • ggederer
    Hi, The following code caused the permiission denied exception in firefox: var tree; function treeInit() { tree = new
    Message 1 of 2 , Feb 14, 2006
    • 0 Attachment
      Hi,

      The following code caused the permiission denied exception in firefox:


      <script type="text/javascript">
      var tree;
      function treeInit() {
      tree = new YAHOO.widget.TreeView("treeDiv1");
      tree.setDynamicLoad(loadDataForNode);

      var root = tree.getRoot();

      var myobj = { label: "mylabel1", id:"myid1" } ;
      var tmpNode = new YAHOO.widget.TextNode(myobj, root, false);

      myobj = { label: "mylabel2", id:"myid2" } ;
      var tmpNode2 = new YAHOO.widget.TextNode(myobj, tmpNode, false);

      myobj = { label: "mylabel3", id:"myid3" } ;
      var tmpNode3 = new YAHOO.widget.TextNode(myobj, tmpNode, false);

      tree.draw();
      }

      function loadDataForNode(node, onCompleteCallback) {
      var id = node.data.id;

      // -- code to get your data, possibly using Connect --
      var responseSuccess = function(o){ alert('responseSuccess'); }
      var responseFailure = function(o){ alert('responseFailure'); }

      var callback =
      {
      success:responseSuccess,
      failure:responseFailure
      };
      var cObj =
      YAHOO.util.Connect.asyncRequest('GET','http://www.yahoo.com',callback,null);


      var tmpNode = new YAHOO.widget.TextNode(id + "label1", node, false);
      tmpNode = new YAHOO.widget.TextNode(id + "label2", node, false);

      // Be sure to notify the TreeView component when the data load
      is complete
      onCompleteCallback();
      }


      </script>
    • ggederer
      Ooops! Copied and pasted example code, and didn t notice the non-originating URL in the connection code. Problem solved! ...
      Message 2 of 2 , Feb 14, 2006
      • 0 Attachment
        Ooops! Copied and pasted example code, and didn't notice the
        non-originating URL in the connection code. Problem solved!

        --- In ydn-javascript@yahoogroups.com, "ggederer" <ggederer@...> wrote:
        >
        > Hi,
        >
        > The following code caused the permiission denied exception in firefox:
        >
        >
        > <script type="text/javascript">
        > var tree;
        > function treeInit() {
        > tree = new YAHOO.widget.TreeView("treeDiv1");
        > tree.setDynamicLoad(loadDataForNode);
        >
        > var root = tree.getRoot();
        >
        > var myobj = { label: "mylabel1", id:"myid1" } ;
        > var tmpNode = new YAHOO.widget.TextNode(myobj, root, false);
        >
        > myobj = { label: "mylabel2", id:"myid2" } ;
        > var tmpNode2 = new YAHOO.widget.TextNode(myobj, tmpNode, false);
        >
        > myobj = { label: "mylabel3", id:"myid3" } ;
        > var tmpNode3 = new YAHOO.widget.TextNode(myobj, tmpNode, false);
        >
        > tree.draw();
        > }
        >
        > function loadDataForNode(node, onCompleteCallback) {
        > var id = node.data.id;
        >
        > // -- code to get your data, possibly using Connect --
        > var responseSuccess = function(o){ alert('responseSuccess'); }
        > var responseFailure = function(o){ alert('responseFailure'); }
        >
        > var callback =
        > {
        > success:responseSuccess,
        > failure:responseFailure
        > };
        > var cObj =
        >
        YAHOO.util.Connect.asyncRequest('GET','http://www.yahoo.com',callback,null);
        >
        >
        > var tmpNode = new YAHOO.widget.TextNode(id + "label1", node,
        false);
        > tmpNode = new YAHOO.widget.TextNode(id + "label2", node, false);
        >
        > // Be sure to notify the TreeView component when the data load
        > is complete
        > onCompleteCallback();
        > }
        >
        >
        > </script>
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.