Computer Dictionary | HTML | Javascripts | Search Engines | SEO | Text Link Guide
Web Design | Ecommerce Software | Michael Wong | Sponsored Links | Help
 
Web Mikes-Marketing-Tools.com

Two Ways To Optimize JavaScripts In Web Pages

Last Update: Saturday, July 04, 2009.

In this article I show you how to optimize your web pages by moving your JavaScript code out of the all-important top portion of the HTML file.

JavaScripts are usually placed in between the <HEAD%26gt; section of a page, which pushes your body text containing your important keyword phrases further down the page.

This can affect the number of keywords that search engine spiders index. It could also makes your keywords less relevant because they appear lower on the page.

The solution is to move the JavaScript code away from the top portion of the HTML file. In fact, I will show you two solutions to resolving this problem.

1. The first solution is to move the JavaScript code into a separate file and link to this file from the HTML file.

This is the preferred solution because it:

  • reduces your file size, and therefore your download time.
  • allows you to reuse the code on other pages by simply linking to this file.

Once you have move the JavaScript code to the new file, add the following code to the <HEAD%26gt;... </HEAD%26gt; portion of the HTML file:

<SCRIPT LANGUAGE="JavaScript" SRC="file-name.js">
</SCRIPT%26gt;

You may replace "file-name" with any file name you like.

Please note that external JavaScript files cannot contain any HTML tags. They must contain only JavaScript code.

Some servers may not recognize the ".js" file type. If that is the case with your server, contact your web hosting company and ask them to add the following line to the "mime.types" file in the server's config directory, and then restart the server.

type=application/x-javascript%26nbsp;   exts=js

2. The second solution is even simply. All you have to do is move the JavaScript code to the very bottom of the HTML file, below the </HTML%26gt; tag.

Yes! It really does work! Although it is considered good programming practice to include your JavaScript within the <HEAD%26gt; portion of a HTML file, it isn't necessary.

That's it! Simple isn't it? I highly recommend you use either of these two solutions to optimizing your web pages that contain JavaScript code.

Internet marketing expert.Michael Wong is the editor of Mike's Marketing Tools, which offers internet marketing tools information and reviews, free marketing tools, and dozens of marketing tips that has been published on thousands of web sites.
Publishing Rights: You have permission to republish this article in your web site, newsletter, or ebook, only on the condition that you republish the article as it is with everything in the article including the links, my bio and photograph left intact. Full instructions on how to copy and upload the photo to your server.

More marketing tips

          

Top 5 Best Sellers

1.Text Links Ads - Buy & sell text links
2.Definitive Guide to Google AdWords - How-to, latest tips, case studies, screenshots, Q&A
3.Internet Business Promoter - Get top 10 Google rankings or money back SEO software
4.Site Build It! - Internet business & marketing system used by 40,000 customers
5.SEO EliteHot! - Big collection of SEO & traffic generating tools
 

Marketing Products

Ad Tracking Software
AdWords Software
Affiliate Marketing eBook
Affiliate Software
Audio Software
Autoresponder Software
Buy Text Links
eBook Covers
Email Marketing Service
Email Marketing Software
Email Marketing Strategies
Internet Marketing eBook
Keyword Research
Learn SEO
Link Building Software
Make Money With AdSense
Make Money With Google AdWords
Pay Per Click Advertising
PPC Management
Sample Sales Letter
Search Engine Submission Software
SEO Software
UpSell
Web Copywriting
 

Ecommerce Software

eBook Software (Self Publishing)
Internet Business
Membership Software
Online Store Software
Register Domain
Shopping Cart Software
Web Design Software
 

Copyright © 2002-9 Art Dacor USA LLC. All Rights Reserved.
3727 West Magnolia Blvd #489, Burbank, CA, 91505, USA.
www.Mikes-Marketing-Tools.com