problem with document.getElementById();
this is bugging me since 7 days...
here i need to do 2 things
1. i need to write some data to the window using window.document.write,
2. i need to dynamically add elements to the window.
my code looks like :
function on_click(){
//second_call();
mywind=window.open("chrome://window/content/style.xul", "Message", "chrome,scrollbars=1,height=300,width=800");
mywind.document.open();
mywind.onload = myLoad(); // () is needed as i used the open function in the above line
}
If i dont use the open i cant use the write function...
the thing is i need to both write as well as add elements dynamically..
function myLoad(){
alert('loaded');
cur = mywind.document.getElementById('outbox');
boxEl = mywind.document.createElement('hbox');
cur.appendChild(boxEl);
var textEl = mywind.document.createElement('description');
boxEl.appendChild(textEl);
textEl.setAttribute('value','india');
}
the style sheet is :
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="example-window" title="Example 2.2.1"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
<popupset>
<menupopup id="clipmenu">
<menuitem label="Cut"/>
<menuitem label="Copy"/>
<menuitem label="Paste"/>
</menupopup>
</popupset>
<vbox id='outbox'>
</vbox>
</window>

