Closed Thread Icon

Preserved Topic: Importing javascript like a stylesheet. (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=17868" title="Pages that link to Preserved Topic: Importing javascript like a stylesheet. (Page 1 of 1)" rel="nofollow" >Preserved Topic: Importing javascript like a stylesheet. <span class="small">(Page 1 of 1)</span>\

 
Awilthil
Bipolar (III) Inmate

From: Drammen, Norway
Insane since: Aug 2000

posted posted 09-24-2000 20:06

I am cleaning up the coding on my site, and wondered if it is possible to save a mouseover script in the same way as you do with stylesheets. I have the same interface on all my pages, and the script is exactly the same on every page. Is it possible to have the script on only one of the pages, and link to it on the another pages?

Anyone know?

Burwell
Bipolar (III) Inmate

From: Drexel Hill, Pennsylvania
Insane since: Aug 2000

posted posted 09-24-2000 21:05

Copy and paste the code into a program like notepad, and save it as code.txt or something that you can easily identify, but make shure it has a .txt extention. upload the file to your server

Then on your page(s) where you want the code place this <!--#include virtual="name_of_file_here.txt" -->

Upload your page(s), and go view them. where you put that code you should see whatever the code is supposed to make. For example a javascript rollover. Also you need server side includes enabled.

Another benefit to this method it that all you have to do is madify the code in the one file and all of your pages are modified whithout uploading them again. You still have to re-upload the text file.

The Digital Future Has More Then One Horizon.

Awilthil
Bipolar (III) Inmate

From: Drammen, Norway
Insane since: Aug 2000

posted posted 09-24-2000 21:06

Thaks a lot. That was the answer I was hoping for. Finally my coding will look nice <img border=0 align=absmiddle src="http://www.ozones.com/forum/smile.gif">

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 09-24-2000 21:06

why use include when you could use the .js extention and call it from that.

Awilthil
Bipolar (III) Inmate

From: Drammen, Norway
Insane since: Aug 2000

posted posted 09-24-2000 21:58

Please explain. I tried saving the script as a JS file and do I that way, but it did'nt work. At least not in Frontpage. Maybe it would work from the server.

Do I still need Server sides includes Enabled. It is disabled at the moment.

[This message has been edited by Awilthil (edited 24-09-2000).]

vogonpoet
Maniac (V) Mad Scientist

From: Mi, USA
Insane since: Aug 2000

posted posted 09-24-2000 22:15

you have to call out the js file from the <SCRIPT> tag I think... sonething similar to

<SCRIPT LANGUAGE="JAVASCRIPT" SRC="your script.js">

I also think you still need to add a ONLOAD to your body tag...

there must be someone else here who can help you further...

this method I think is more straight forward than SSI

sorry not to be able to be more helpful as I am on the same kind off learning curve!



Awilthil
Bipolar (III) Inmate

From: Drammen, Norway
Insane since: Aug 2000

posted posted 09-25-2000 02:06

Figured it out. Thanks for the help.

mario
Nervous Wreck (II) Inmate

From: germany
Insane since: Sep 2000

posted posted 09-25-2000 15:49

the correct code is:
<script language="JavaScript" src="your_file.js" type="text/javascript"></script>

vogonpoet
Maniac (V) Mad Scientist

From: Mi, USA
Insane since: Aug 2000

posted posted 09-25-2000 16:07

thanks Mario.. I knew it was something llke that!

« BackwardsOnwards »

Show Forum Drop Down Menu