It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

writing to the child window

writing to the child window

Postby clyde on Tue Mar 04, 2008 3:16 am

Using document.write works fine, but I want to write to an anchor tag in the child popup window. I tried:

mychildWin.document.getElementById("childAnchor").value = "Hello";

which fails and when I popup an alert(mychildWin.document.links[0].value);
I get null. But the popup has this element.

When I use mychildWin.document.write("hello"); the hello appears fine.

What am I missing here?
clyde
 
Posts: 2
Joined: Tue Mar 04, 2008 3:06 am

Postby rangana on Tue Mar 04, 2008 3:59 am

I suppose it should be:
Code: Select all
document.getElementById('childAnchor').innerHTML = 'Hello';


See if it helps :D
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines

Thanks for your help

Postby clyde on Thu Mar 06, 2008 3:55 am

I am afraid it did not work either. When I check to see if the anchor is there I get null. Even tho my child window has this:

<a href="#" id="childAnchor">Hi</a> and I see the "Hi" on the page.
It claims that there is no element in mywin.document.getELementById("childAnchor");

I am confused. :(
clyde
 
Posts: 2
Joined: Tue Mar 04, 2008 3:06 am


Who is online

Users browsing this forum: No registered users and 5 guests