/    Sign up×
Community /Pin to ProfileBookmark

Download and append script to next page

Hi..

I have a prototype that does this server side, but was hoping I could achieve it client side..

if someone were to start from my page, enter a URL into a text box and submit..

I want to be able to append some java script to the next page.. But it would show the next page as normal..

However, when that page finishes loading, I want to trigger my java script which starts a timer, and when they click away from the page, it stops the timer, but makes sure the java script is present on the next page they go to..

Actualy showing the total in a small floating div..

I understand to get the java onto every page, I probably have to download the page in the javascript, then alter the current page to show the new page, with an added function..

Firstly, can it be done…

second, where on earth do I start!

any advice or points in the right direction would be gratefully received..

Spaced

###>====>

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@KDLAJan 12.2010 — I would think you could do that passing hidden inputs, form to form. The form on the second could be invisible.
Copy linkTweet thisAlerts:
@spacedcadetauthorJan 12.2010 — If I don't own the page they are going to, SAY google.com - they type that in, I want to get my function onto their page, and then onto the next page...

You say passing as a hidden field.. but how do I get the receiving form on the next page?
Copy linkTweet thisAlerts:
@KDLAJan 12.2010 — Oh - I thought you meant page-to-page within your website.

You can't do that with external websites.
Copy linkTweet thisAlerts:
@spacedcadetauthorJan 13.2010 — Could a web page not bring down xml in the background, and add things to it...

html is a form of xml..

then put that page up instead of the existing page?
×

Success!

Help @spacedcadet 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.20,
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,
)...