Search
Recommended Sites
Related Links






   

Informative Articles

21 Simple Ways To Make More Money From Your Current Clients, Part 2
It is easier to make additional money from your current clients than it is to go out and find new ones! See 21 simple ways in this three part article series. PART TWO: Here are seven more great ways to make more money from your existing...

Clean up Your Code for Good SEO
Do you have lots of JavaScript coding in the header section of your web pages? Do you re-list your CSS styles at the top of every page? Do you have JavaScript coding spread throughout your web pages? If you answered yes to any of these questions...

Creating Pop Ups and Tips on Using Them
Creating Pop Ups and Tips on Using Them As I said before, it's a proven fact that the use of pop up windows is a highly effective marketing technique that produces great results. Below, is an example of a popup window that you can use to gain...

Internet Promotion: Ezines
One of the more important things that you can do to generate return visits to your web site is to publish an e-newsletter (or e-zine). Give your visitors a chance to subscribe on your home page, and you've got them for life! That is, as long as you...

Is Your Site A Rich Feast Or A Dogs Breakfast? Part 2 of 2
Nice sizzle, shame about the sausage. Legendary St Kilda and Hawthorn coach Allan "Yabby" Jeans summed it up in his famous post game quote. All the PR, advertising spend and marketing resources will only get you so far. The web junk yard is full of...

 
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.