Log In     forgot my password   |  register  
real advice for real life
The advice you need may be closer than you think. Advice Network is your communities solution to neighborly advice and information. Sign up as a vendor to post and get business, or find a professional to help with your projects. It's quick, easy and fun.  
nav Find A Pro Vendor Listings Submit an Article
Put away the phonebook. Stop searching the web. Get matched with vendors in your area.
Search the Advice Network directory of vendors in your local area.
Submitting an article is as easy as filling out a form. Submit Article
categories
  Business and Professional Services
  Real Estate, House, and Home
  Weddings and Events
advice article Flag as spam or inappropriate.
How to Make Java Script Search Engine Friendly
Posted 01-21-2009 : by Jennifer Horowitz
Category : Business and Professional Services
Subcategory : SEO


Think of the search engines like a child with a short attention span. If they have to crawl through tons of messy code before they get to the body content on your page, there is a chance they will "lose interest" and not continue spidering the page.

Since you want the engines to be able to spider all of your content pages, you should minimize the amount of extraneous code that is on your page. You worked hard to create your content and get your site optimized, so the last thing you want to do is take a chance that the engines won't want to spider your pages.

One way to clean up the code is to take java script that is on-page and put it in an external .js file.

Java script on your page usually takes up anywhere from 3 - 8+ lines of code. That is all just creates extra code that the spiders have to crawl through before they get to your body text. You are better off calling your java script in from a .js file. This takes what used to be many lines of code on your page and reduces it to one line where you just call the script in.

To create an External JavaScript file:

Copy your script and paste it into Notepad.

Remove the beginning and end script commands. They are:

< script language="JavaScript"> and < /script>

Next, do a SAVE AS command and save the file as "text only" with an extension of .js

Example: java.js

Upload the file to a folder on your server that you name Java. (Or whatever name you wish.)

To call your Java file into your web page, enter into the same place where the script originally was:

< script src="Java/java.js"> < /script >

Lastly, if you wish to hide the text from JavaScript impaired browsers to avoid error codes, surround the JavaScript with in your java.js file.

This will make for cleaner code, and the functionality will still be the same.

You could also move your script to the bottom of the page - but remember if the page doesn't fully load then your script may not load, so it could impact the functionality of your page.

Whatever solution you choose to implement - make sure you test it to ensure it works. Once the engines pick up your pages and the traffic to your site increases, you want to be sure the site is fully functional and in tip top shape.


Jennifer Horowitz is the Director of Marketing for EcomBuffet.com. Over the past 10 years Jennifer's expertise in marketing and Search Engine Optimization (SEO) has helped clients increase revenue. Jennifer has written a downloadable book on SEO and has been published in many SEO and marketing publications. Jennifer is the editor of the popular Spotlight on Success: SEO and Marketing newsletter. Follow Jennifer and stay current on SEO, marketing, social media and more. http://twitter.com/EcomBuffet

 
Author's Name : Jennifer Horowitz
Author's Business Name : EcomBuffet.com, LLC
 
 
3
 take it
 
0
 leave it
        Stumble Upon
Comments On This Article Post Your Comment 
No Comments Found.
......More Articles
newsletter
vendor spotlight
Info Edge India Ltd.
Times are changing and so are the requirements and demands of people. ...
customer spotlight
testing for getting spotlighted...
rss feed
Keep up-to-date with our RSS feed.
Select Category
Select Subcategory

 

nav Find A Pro nav Vendor Listings nav Submit an Article nav
Put away the phonebook. Stop searching the web. Get matched with vendors in your area.
Search the Advice Network directory of vendors in your local area.
Submitting an article is as easy as filling out a form. Submit Article
About | Privacy Policy | Support | Jobs | Contact | Vendor Login | Vendor Registration