Updating a popup window from source page

Posted by Blem on Stack Overflow See other posts from Stack Overflow or by Blem
Published on 2010-06-08T09:17:05Z Indexed on 2010/06/08 9:22 UTC
Read the original article Hit count: 170

Filed under:
|
|
|
|

I have a list of people wrapped in a-tags with onclick for opening a popup window.

That popup window contains a previous and next button that invoker a function in the parent window to get the previous/next a-tag and execute the onclick for it.

nextAnchor.onclick();

This should update the popup window with the new persons info, but it doesn't update. Adding an alert("") right after makes it update. What i found searching is something about having to leaving the session before JavaScript will update the display and they suggested using setTimeout.

Problem is i'm calling on a DOM element and i can't send it in to the setTimeout, so i ended up with

setTimeout('eval("'+nextAnchor.getAttribute("onClick")+'")',10);

So is there another way to make it update or a way of making the setTimeout use the onclick of a DOM element or is this an acceptable solution even though it uses eval?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about update