/    Sign up×
Community /Pin to ProfileBookmark

JavaScript Library

Can anyone tell me how to construct a file that contains JavaScript functions that can be shared across multiple ASP pages?

What I’m after is a file that I can ‘include’ in ASP pages so that I don’t have to repeat the same code on each page. I hope this makes sense!

Thanks

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@TaffyLewisMay 14.2008 — If I understand what you're writing, then all you would do is put your Javascript functions in a file and any page could reference it as follows:

<script src="xxx.js">

</script>
Copy linkTweet thisAlerts:
@JMRKERMay 14.2008 — One caveat:

Make sure the included script is pure JS, no HTML tags or comments.
Copy linkTweet thisAlerts:
@SergioGauthorMay 17.2008 — If I understand what you're writing, then all you would do is put your Javascript functions in a file and any page could reference it as follows:

<script src="xxx.js">

</script>[/QUOTE]

Taffy, thanks, this is what I am looking for I believe. I will give it a go.
Copy linkTweet thisAlerts:
@Declan1991May 17.2008 — Don't forget your type attribute as well:[code=html]<script type="text/javascript" src="whatever.js"></script>[/code] an always have a separate closing tag, not ever[code=html]<script type="text/javascript" src="whatever.js" />[/code].
×

Success!

Help @SergioG 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.6,
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,
)...