/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Remember this script?

Within the last 3 months I thought I saw a script on this forum
that would allow one to add an external JS file to the head section
AFTER the page had loaded. I think it allowed some functions
to be used after a user’s selection.

I searched the forum, but I must not be using the right keywords
as I cannot find where the script was referenced.

(I tried: ‘add to head’ and ‘add external to head section’)

Does anyone remember this script or how it was done?
(This assumes that I have not lapsed into my old-timers mode and CRS).

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Dec 10.2007 — Something like this:

<i>
</i>var scr = document.createElement("script");
scr.src = "foo.js";
document.getElementsByTagName("head")[0].appendChild(scr);


Eric
Copy linkTweet thisAlerts:
@JMRKERauthorDec 10.2007 — That looks familiar. I'll give it a try.

Thank you.
Copy linkTweet thisAlerts:
@JMRKERauthorDec 10.2007 — Yep 'A1ien51' that was it ... works like a charm.

Thanks again.
×

Success!

Help @JMRKER 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 4.29,
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,
)...