Making and Linking to External .js files.
You can make a .js file from any normal javascript by stripping out the opening and closing tags.
Let me show you what I mean!
Here is a javascript for vertical scrolling text.
---------------------------------------------------
------------------------------
Making and Linking to External .js files.
You can make a .js file from any normal javascript by stripping out the opening and closing tags.
Let me show you what I mean!
Here is a javascript for vertical scrolling text.
To make the above into a .js file, simply take out the first line
".
Copy and paste that code into windows notepad and save it as scroller.js or whatever. Make sure when you save the file you choose "Save as type" is set to "All files".
Linking the .js file
On the page you want the scrolling text to appear place this simple code below. You can place it on as many pages as you want:
---------------------------------------------------------
---------------------------------------------------------
Upload both your scroller.js file and the page with that simple code on it to your webhost.
Now each time you want to change that scrolling text you only need to edit that one scroller.js file.
The best program to edit .js files with is called EditPlus. You can download it from http://www.editplus.com/download.html It's only 1 mb download. Even though it says 30 day trial it never stops working after that time.
If you want to use this vertical scrolling text script, to change the text, you open your scroller.js file in Notepad and go to line 7. That line must have this on it: var scrollercontents='Your Text Here' Your text must be between the two ' ' and you can also insert HTML tags to choose color and links etc. You'll notice I have some text and HTML in that line already. You simply take that out and place your own in.
Linking to external .js files saves you a lot of time and trouble. This can be somewhat more efficient if you have several pages using the same routine. You simply have it once as an external file and refer to it as needed from each of the files needing that routine. This could be much less effort if you have to edit the same JavaScript routine located on several pages - you could make only one update!