/    Sign up×
Community /Pin to ProfileBookmark

Too big javascript

The situation is that I have a rather big/long javascript in my html file and I would like to find a way to make it easier to download my page. What would be the best thing to do? ? If you could give me some suggestions or an idea where I can find info on coping with this problem. I would be grateful. Thanks.

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@jochemDec 04.2003 — If the script is being used in more than one HTML page, you might considder creating an external .js file. Then, just call on it from each HTML page that needs the script, just like an external .css file.

<script language="JavaScript" src="yourscript.js"></script>

Cheers, Jochem ?
Copy linkTweet thisAlerts:
@Paul_JrDec 04.2003 — I believe the "language" attribute has been [URL=http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.2.1]deprecated[/URL].
×

Success!

Help @gotfrid_mc 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.18,
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,
)...