What I've got:
1) a page with a "window.open('s ome_html', ...)"
2) "some_html" with basically this:
<body onload="documen t.body.innerHTM L=FillIt('some_ id')"></body>
3) a script:
function FillIt(my_id) {
var inner = window.opener.d ocument.getElem entById(my_id). cloneNode(true) ;
var a = document.create Element('a');
a.setAttribute( 'title', 'Close this window');
a.setAttribute( 'href', 'javascript:sel f.close()');
var img = document.create Element('img');
img.setAttribut e('src', 'some_image');
img.setAttribut e('alt', 'pop_down');
a.appendChild(i mg);
inner.replaceCh ild(a, inner.getElemen tById('popup')) ;
return inner.innerHTML ;
}
This won't work. For sure I am doing something dumb in here (I'm a
newbie) but I think "innerHTML" just won't work with "replaceChi ld".
Please note there's only one 'popup' ID in my original DOM tree (it's
a table) and no, I'd not like to iterate on all the table elements just
to put it together in the end ...
Looking for some advise.
Thanks,
--
Michal Kurowski
<mkur@poczta.ga zeta.pl>
1) a page with a "window.open('s ome_html', ...)"
2) "some_html" with basically this:
<body onload="documen t.body.innerHTM L=FillIt('some_ id')"></body>
3) a script:
function FillIt(my_id) {
var inner = window.opener.d ocument.getElem entById(my_id). cloneNode(true) ;
var a = document.create Element('a');
a.setAttribute( 'title', 'Close this window');
a.setAttribute( 'href', 'javascript:sel f.close()');
var img = document.create Element('img');
img.setAttribut e('src', 'some_image');
img.setAttribut e('alt', 'pop_down');
a.appendChild(i mg);
inner.replaceCh ild(a, inner.getElemen tById('popup')) ;
return inner.innerHTML ;
}
This won't work. For sure I am doing something dumb in here (I'm a
newbie) but I think "innerHTML" just won't work with "replaceChi ld".
Please note there's only one 'popup' ID in my original DOM tree (it's
a table) and no, I'd not like to iterate on all the table elements just
to put it together in the end ...
Looking for some advise.
Thanks,
--
Michal Kurowski
<mkur@poczta.ga zeta.pl>
Comment