/    Sign up×
Community /Pin to ProfileBookmark

using dialogArguments to call a function?

can you call a function from the page that opened a modal window from within the modal window? i have a function called test() and i try to call it like so:
dialogArguments.test();
i get a this object does not support this method error. help!

i know you can pass variables through the 2nd argument of the showModalDialog function, but what about a function?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@UltimaterSep 21.2005 — Only works if there is no cross-browser security issue.

To avoid that, since we are already using Internet Explorer, change your file extension from HTML or HTM to HTA.
Copy linkTweet thisAlerts:
@ck_bulletauthorSep 21.2005 — the file that is opening the modal window or the source of the modal window needs to be .htm? or both? the file that is opening the modal window is a php file in my case.
Copy linkTweet thisAlerts:
@ck_bulletauthorSep 21.2005 — i figured it out. you have to pass the window object as the argument when you call showModalDialog

so:

window.showModalDialog("example.html", window, "options go here");
×

Success!

Help @ck_bullet 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.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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