/    Sign up×
Community /Pin to ProfileBookmark

Urgent : Help needed : window.opener not working

Here is the scenario :

I open a pop-up window using JS code in my JS file. There are a few buttons and a table drawn in that Pop-Up window.

On clicking a button in the Pop-Up window, I am calling a JS function using “window.opener.<Func_Name>;”
This is working fine.

When I click on this button; in this function <Func_Name> , I am rewriting the contents of the PopUp i.e. I am erasing the old contents (newWindow.document.getElementsByTagName(“Body”)[0].innerHTML=””; ) and putting new contents.

In this new content, I again have a table and some buttons with which I associate a function in exactly the same way I did before(“window.opener.<Function2_Name>;”)

Till here, everything is working fine(ie From the first popUp, I click a button, the Function <Func_Name> is called, it redraws the PopUp with the table and the buttons exactly as intended). The problem crops up now when I click a button on this latest PopUp. It does not call the function <Function2_Name> to which I associated it with neither it throws up any error although I have virtually copied the contents which I had previously in the Pop-up.

? I am baffled how to go about it.

Plz help.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@KorJun 04.2008 — [B]innerHTML [/B]is [I]not[/I] a standard DOM method, thus it does not really insert /replace the elements into the DOM tree. You must use DOM methods to do that.
×

Success!

Help @soshah spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...