Shopping Cart Hosting & eCommerce Merchant Account Integration services

 

Request a Free Quote

Contact Us - Call 1-877-627-2492    


 
Earth Skater Custom eCommerce [Home]
  Authorize.net Certified Developer PayPal Certified Integration CyberSource Certified Developer
      You are here:   Home · Marketing Services · Marketing Articles      
 
eCommerce Hosting
Affiliate Software
Website Analytics
Merchant Accounts
Merchant Integration

Internet Marketing
Content Management
Custom Development
Custom Web Design

Why Earth Skater
Our Clients
Our Partners
     

E-Commerce Blog

eCommerce 101 & Merchant processing
4 September 2008

 
 

Earth Skater Internet Marketing Articles

2 Ways To Optimize JavaScript Code In Web Pages

Optimize your web pages by moving your JavaScript code out of the all-important top portion of the HTML file.

JavaScript is 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.


Call 877-627-2492 to discuss your marketing plan today.
 

Author: Michael Wong is the editor of GoDefy.com - the world's first internet marketing comparison shopping search engine and Mike's Marketing Tools. Michael is also the author of the leading SEO book and numerous marketing tips. Visit his web sites at http://www.goDefy.com & http://www.Mikes-Marketing-Tools.com

 

Home | eCommerce Shopping Cart | Affiliate Software | Website Analytics | eCommerce Merchant Accounts | Merchant Account Integration

Help & Support | Contact | Request a Quote | Affiliates | Developer Articles | Marketing Articles | Blog | Policies | Site Map

© 2008

Earth Skater  Boca Raton Web Design Florida FL USA  

Content last updated 7/30/2008