/    Sign up×
Community /Pin to ProfileBookmark

I’m creating a webpage that will contain the same navigation menu on every page. I used Javascript to create mouseover effects for each button. Instead of writing the same code over and over on each page I wanted to create an external script that I could call. However, every example I’ve found online doesn’t seem to help my situation. Is it possible? If so how do I call the script?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@ck_net_2004Sep 04.2004 — You just need to put your JS code into a text editor and save

it as a .js file and dont include any <script> tags then

load it into the web page you want it in with this:

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="yourfile.js"></SCRIPT>


in the head of your page.
Copy linkTweet thisAlerts:
@steelersfan88Sep 04.2004 — [i]Originally posted by ck_net_2004 [/i]

[B]<script type="text/javascript" src="yourfile.js"></script>[/B][/QUOTE]
Lowercase is *preferred* and the language attribute has been depreciated for quite some time now.

Dr. Script
Copy linkTweet thisAlerts:
@BNPerformanceauthorSep 07.2004 — Thank you both!
×

Success!

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

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

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