Search
Recommended Sites
Related Links






   

Informative Articles

Dirty Web Promotion Tricks #1 - Legitimate and Malicious Javascripts
One of the best way to get visitors to further explore your site is to convince them to set your home page as their Internet start page, or for them to add you their "Favorites". In this article, we'll examine some ethical and unethical ways this...

Introduction To Web Technologies
There are literally hundreds of difficult technologies available to the webmaster. Making proper use of these technologies allows the creation of maintainable, efficient and useful web sites. For example, using SSI (server side includes) or CSS...

San Francisco Web Development - Tools
"Web development encompasses many stages i.e. Planning, Analysis, Web design, Implementation, Promotion and Innovation. Each of these stages requires use of different sets of tools and professionals with varied skill sets. Planning and...

The Power of Link Popularity
Getting quality links to your site from related web resources can be very difficult. It is a time consuming process and requires careful research. There are two ways to build your link popularity; 1 Make your site attractive to webmasters or 2...

Why You Should Use Turnkey Websites To Jumpstart Your Ecommerce Activity
Most people looking to do business online have heard of turnkey websites. They seem to be a one stop solution to getting an online business going without all the usual hassles associated with an online startup. Take a look thought the business &...

 
Using External JavaScript Files

When you have lots of JavaScript functions and you plan to use
them on many web pages, it is always advisable to keep them in a
separate file, and then include that file on every page where
those functions are required. This way, you can better organize
them, you don't have to copy/paste the code again and again
(imagine if it runs to 100 or more lines!!), and you'll be forced
to write more generalized code for better integration and
scalability.

Besides, enclosing the common JavaScript routines in external
files keeps your web pages uncluttered and search engine spiders
and crawlers are able to reach the important content easily. They
don't have to shuffle through tens of lines of scripts.

In the first edition [that appeared in my newsletter - BYTESWORTH
REACHOUT] of my article I had omitted the process of creating the
external JavaScript files, but when one of my readers asked me
how to do it, I had to re-write the article.

It's very simple. Use any text editor of your liking (if you
hand-code your HTML, you can use the same editor that you use for
your HTML editing). Write the required code, and save the file
with .js (dot js) extension.

I'm going to give you a small example.

Suppose your JavaScript file is "myjfuncs.js".

and it has a function to return the bigger number of the two
supplied as parameters (you can simply start with the function,
no need to write

So when we use one of its functions in a JavaScript:



In this way, we can use all the complex functions contained in
the myjfuncs.js file.

About the Author
Amrit Hallan is a freelance web designer. For all web site
development and web promotion needs, you can get in touch with
him at amrit@bytesworth.com or http://www.bytesworth.com. For
more such articles, visit http://www.bytesworth.com/articles You
can subscribe to his newsletter [BYTESWORTH REACHOUT] on Web
Designing Tips & Tricks by sending a blank email at
bytesworth-subscribe@topica.com

Sign up for PayPal and start accepting credit card payments instantly.