Changes between Initial Version and Version 3 of Ticket #5005


Ignore:
Timestamp:
Dec 7, 2007, 4:42:35 PM (12 years ago)
Author:
bill
Comment:

Just formatting the code segments above.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5005

    • Property Owner changed from anonymous to bill
    • Property Reporter changed from guest to byersa@…
    • Property Component changed from General to Dijit
    • Property Milestone changed from to 1.1
  • Ticket #5005 – Description

    initial v3  
    33
    44I have a situation in which I am trying to dynamically change the content of an iframe with code like:
     5{{{
    56var refNode = dojo.doc.createElement("div");
    67var newWidget = new cls({...}, refNode);
    78ifr.contentWindow.document.body.appendChild(newWidget.domNode);
     9}}}
    810
    911This works in FF, but not IE. It complains about an "invalid argument". I finally figured out it was because the element that I am appending was not created by the iframe's document. I thought an answer to this would be to create refNode like this:
    10 
     12{{{
    1113var refNode = iframe_contentwindow.document.createElement("div");
    1214var newWidget = new cls({...}, refNode);
    13 
     15}}}
    1416But in poking around in _Templated, I find that it uses "dojo.doc" to create the element it returns. I changed the code for it to see if it has a "this.srcNodeRef" and uses it's ownerDocument to create an element and that seems to work. I had to add "srcNodeRef" to _Templated and move the "tn" var inside the function so it gets recreated each time.
    1517