/    Sign up×
Community /Pin to ProfileBookmark

Execute javascript in a redirected page

Is it possible to execute a javascript function in a redirected page?
For example:
I push a button in page1.html and it redirects me to page2.html in the same window. And in the page2.html a javscript function (that I pointed in the page1.html) will be executed.
To insert the javascript directl in the page2 is not possible.

I’ve tried to make a popup in the page1 which has a function in it that after a while tries to execute the javascript with the window.opener function. But it did not work…

Any ideas?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@BigMoosieAug 24.2005 — It is not possible in any of the major browsers as it is considered a security risk.
×

Success!

Help @voodoolv 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.28,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

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