PDA

View Full Version : external javascript link


learning
06-23-2003, 12:42 PM
I have searched the forum and found this for css but not for javascript.


The site I have developed for our organization at www.alp72.com has a javascript for a top menu which is on every page in the site.

I would like to make this an external link so when I update the external file all pages update.

As you can tell I am just a novice as I couldn't even write the script for this myself or I probably would have know the answer before I asked the question.

Thank you for your assistance.

Learning

Nightfire
06-23-2003, 01:12 PM
Put all your script into a *.js file, take out the <script></script> tags, then in the header of your html page, use

<script src="path/to/jsfile" type="text/javascript"></script>

ronaldb66
06-23-2003, 01:23 PM
While you're at it, do check why that page is about twice as wide as the actual content, and look up what the colspan attribute was actually for again; I saw things like 'colspan="700"', 'colspan="655"', 'colspan="400"', and that seems like a lot of columns to me...

giz
06-23-2003, 11:39 PM
Search engines cannot follow javascript links, so if you want to be listed in search engines you will need to do additional work.


Create a sitemap page and populate it with normal HTML links to all of the other pages of the site. Then, on every page of the site put in a normal HTML link to that sitemap page.

This will keep search engine spiders happy, as well as the 10 to 15% of surfers that browse with javascript turned off, or who have browsers without javascript (screen readers for dispabled folks for example).


Update strategy: just two pages to maintain, the javascript menu, and the HTML sitemap page. Ignore the latter at your peril.

learning
06-25-2003, 02:58 PM
Thanks for the help but it still doesn't work.

Guess it has something to do with the JS file link after the initial script tags.

I'll keep working at it.

Thanks again

learning