PDA

View Full Version : event handler to load new URL in parent browser window


chump2877
08-25-2005, 10:21 AM
Easy question I think....Did a search and couldn;t find answer....

Is there an onClick event handler that I can use that will load a new URL in the parent browser window (the button that will do this is inside a separate, pop-up window)...

I already have this event handler:

onClick='javascript:window.close();'

I want to add the "load-URL-in-parent-browser-window" functionality to that onClick event, if possible....

Thanks.

martin_narg
08-25-2005, 10:31 AM
no need to use "javascript:" in your onclick attribute.

This should work:

onclick="if(opener && !opener.closed)opener.location='myPage.html';window.close();"


Hope this helps

m_n

chump2877
08-25-2005, 10:50 AM
that's perfect... :thumbsup:

Thanks. :)