/    Sign up×
Community /Pin to ProfileBookmark

Calling javascript function across jsp pages

Dear all,

I’ve 2 jsp pages (main1.jsp and main2.jsp) where i define a javascript function called mainfunc() in main1.jsp.
I can call mainfunc() from main2.jsp using javascript:mainfunc();
Now i create a child window from main1.jsp using

winref = window.showmodelessdialog(“child.jsp”,window,”width:400;height:200″);

But i cannot call javascript:mainfunc(); anymore from this child window (child.jsp). Does anyone know why? How do i go about doing it? I guess I’ve to somehow retreive the parent’s winref and use it?

Thanks!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorMay 29.2009 — <i>
</i>[COLOR="Blue"]opener[/COLOR].mainfunc()
Copy linkTweet thisAlerts:
@rationaliseauthorJun 01.2009 — <i>
</i>[COLOR="Blue"]opener[/COLOR].mainfunc()
[/QUOTE]



Hi , thanks for replying to my query. When i try to use opener.mainfunc(), an error tells me that opener is null or not an object. Hmm. What could be wrong?

Thanks.
×

Success!

Help @rationalise 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 5.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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