/    Sign up×
Community /Pin to ProfileBookmark

Exhausted with external javascript

I am using this free menu : [URL=”http://simplythebest.net/scripts/DHTML_scripts/dhtml_script_79.html”]http://simplythebest.net/scripts/DHTML_scripts/dhtml_script_79.html[/URL]

It works great in the HTML page, but i don’t want to have to edit 30 differnet pages when a change is made.

I have taken the step #1(from the url above) and made it an external file called menumine.js
I removed the <script> tags.

I added the <script type=”text/javascript” src=”/menumine.js”> to my <head> section.

I left step#2: the handler on each page as I will not be changing this.

in step #3: I have tried removing this, leaving this…not sure how to handle it, but i can not get this menu to show up when calling the external file.

All help is greatly greatly appreciated. i have read forum after forum and, many articles and can’t figure out what i have done wrong. Thanks:eek: 😮

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERMar 14.2008 — Just an idea, ignore it if it has no effect:

Change:

<script type="text/javascript" src="/menumine.js">

To:

<script type="text/javascript" src="menumine.js"></script>

More often than not, files are not normally stored at the root '/' directory.
Copy linkTweet thisAlerts:
@gracedogauthorMar 14.2008 — Yeah, tried that too, when i leave the third step in the HTML pages:

<script language="JavaScript" type="text/javascript">showMenus(1,'vertical')

</script>

it sends an error message of unexpected object, if i take it out nothing happens.

Thanks for the thoughts though.
Copy linkTweet thisAlerts:
@JMRKERMar 14.2008 — Post the script or a link to the script.

Also, if on a server, make sure the external file has 'read' permissions set.

Note:[code=php]
<script language="JavaScript" type="text/javascript">showMenus(1,'vertical')
</script>[/code]

won't work if the function 'showMenus' is not already loaded in the head section.

Don't know for sure, but this may be where the error message is comming from.
×

Success!

Help @gracedog 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.9,
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,
)...