Wednesday, May 28, 2008

Free Javascript Downloads

Ever heard of javascript?

Well if you haven't you should.

You see, javascript is the easy way to do many things on your web site. Things like showing the current date, keeping your copyright date current, showing alert messages and a whole lot more.

Now I'll freely admit that I'm not a javascript expert however I have learned a few things about it since there's so many free javascript downloads available. And today I'd like to share 4 of them with you.

  1. Until recently search engines couldn't read javascript so they didn't like it. However, some search engine spiders like Google's can now read some javascript code and pick up links. I say some because some search engines still can't read javascript and of those that can, they still can't always read the links contained in the code. That means if you're using javascript for your site's menu only some or none of the search engines will see the links to your other pages.

  2. Unencrypted javascript code contained in your web page's html code will not hide a link or email address from hijacking bots (automatic software that looks for download links and email addresses).

  3. When you put javascript code into your web page's html code you can get some neat effects however you are not using 1 of the best benefits of javascript. Using an external javascript file and calling it from your html code makes it easy to use that script on as many of your web pages as you want. And if you ever need to make a change you have only 1 file to change.

  4. Many times the javascript contained in the html code can be easily modified and made into an external javascript file.

Here is an example of how easy it can be to put a free javascript download into an external javascript file.

Below is a free javascript download from http://javascript.internet.com/page-details/email-protector.html. (Please pick it up from their site since Blogger doesn't always display html type code correctly.) This code is to help you protect your email address and the instructions say to place the code where you want your email address inside the body tags of your html file.

< !-- ONE STEP TO INSTALL EMAIL ADDRESS PROTECTOR:

< BODY>

< SCRIPT LANGUAGE="JavaScript">

< !-- Original: CDR Software --> < !--
Web Site: http://www.cdrsoft.com/ -->

< !-- This script and many more are available free online at --> < !-- The JavaScript Source!! http://javascript.internet.com/ -->

< !-- Begin
user = "username";
site = "yoursite.com";

document.write('< a href=\"mailto:' + user + '@' + site + '\"> ');
document.write(user + '@' + site + '< /a> ');
// End -->
< /SCRIPT>

< p> < center>
< font face="arial, helvetica" size="-2"> Free JavaScripts provided< br> by < a href="http://javascriptsource.com"> The JavaScript Source< /a> < /font> < /center> < p>

< !-- Script Size: 0.68 KB -->


Here's what it looks like on your web page.

username@yoursite.com

Free JavaScripts provided
by The JavaScript Source


Now don't run away because it looks like a bunch of gibberish.

You only part of the code you need is after the <!--Begin and before the //End -->

user = "username";
site = "yoursite.com";

document.write('< href="\"> ');
document.write(user + '@' + site + '< /a> ');

Now put those 4 lines of code in a file with a .js extension like sendme.js. Then put this code where you want to have your email address shown inside your html code.

<script language="javascript" type='text/javascript'
src='http://www.yourdomain.com/sendme.js'></script>

Everything between <script ... js'> is in a single line of code. It looks like 2 lines because of the width of this page. Also be sure to replace 'yourdomain.com/sendme.js' with your domain name and the path to your file.

That wasn't too difficult was it? Now not all of the free javascript downloads are that easy to change but a lot of them are.

Oh, in case you're wondering why you would want to place this javascript in it's own .js file there are 2 very good reasons.

  1. If you ever need to change your email address you have 1 file to change instead of changing it on each individual web page.
  2. Having a little ad for a free script site right next to your email address doesn't look very professional unless you're the script site owner. And while you should acknowledge that you are using someone else's script on your web page, you can place the acknowledgement where you want it.

Other examples of how easy it is to take a free javascript download and put it in its own .js file include the code for:

And again, all you need to put in the external .js file is the code between the and then you place the 2 lines of code to call the javascript file in your html file where you want the information to appear. And while it's doubtful you'll ever need to change these .js files, you may not want that free ad right next to these dates.

There are a lot of things you can do using free javascript downloads. Simply go to you favorite search engine and search for free javascript and you'll find many sites like TheJavaScriptSource where you can get and use thousands of free pre-written javascripts.

To Your Success,
Susan

Tags: , , , , ,