This is a short guide who will teach you how to download, and use JavaScripts.
First lets explain how to download a JavaScript :
The best way, is to right click on the link to the JavaScript and then select from the pop-up menu
save target as (Microsoft Internet Explorer) or Save link as (Netscape).
Then choose a directory to place the script
A second way is to click on the link to the JavaScript, and while on the page with the JavaScript select from your browsers menu : File and then Save as
A third way is again while beeing on the page with the Script to right click within the browser window and then select : view-source. Then you just copy the whole html document and paste it in your favorite HTML or Text editor Notice : The last two methods may not work if the JavaScript uses constantly alert or confirmation boxes The procedure to overwrite this, is to simply disable jaavscript from your broswers preferences / options and then view the page again Since JavaScript is disabled nothing will happen, but you will be able to view and copy the source Just remember to reactivate JavaScript in your browser...
Now lets explain how to use the Scripts at your homepage
After having downloaded the Script to your Hard Drive, use your favorite HTML or Text editor to open it and view the source code All you have to do is to copy from the source script everything that is between the tags <Script Language="..."> </Script> (Including the tags off course)
The best position to paste this lines at your page is right after the <HEAD> tag
What you also need to notice is, that many JavaScripts have event handlers in the BODY tag
What are event handlers ? The most common event handlers in the BODY tag are the onLoad="..." and onUnload="..." These event handlers need to be copied and pasted in your homepages BODY tag EXACTLY AS THEY APPEAR IN THE SOURCE SCRIPT My suggestion (to avoid mistakes) is to copy and paste the BODY tag from the Source script and then just change the colors, according to your wishes Finally some points you need to watch out (to avoid errors) :
First many of my Scripts also use some style- sheets So you need to copy and paste the Style-Sheet also The Style Sheet is between the tags <Style..> and </Style> Just copy and paste those lines too position the style sheet right after the closing Script tag </Script> Extra care should also given when you change the Scripts (to display your own messages) All messages must be between quote marks " or ' .Which mean your message must start with a quote and end with a quote
Now the crucial point is to avoid using the quote mark in your sentance Exapmle : I want to type Hi I don't like this I have to put it (as mentioned above) in quotation marks If I write "Hi I don't like it" it will work, error free, but if I write 'Hi Idon't like this' i will get an error Why ? Because in the second case I used wrote my message between ' quataion marks. But this mark was also used in my sentance (don't) So JavaScript will think that your sentance is 'Hi I don' and will take the rest (t like it) as JavaScript source code, which will generate an error So how can you avoid this ? Simple you have to use a backslash ( / ) before using a quotation mark within your sentance . Example :
'I don\'t like this' now it's error free. So what if you want to use a backslash in your sentance ? Just type it twice \\ That's all in a short way Having read this will make you understand JavaScript better and make you avoid the errors