Featured Links

Other Topics
Sponsored Links





Quote of the Day

"Life is about timing."

Carl Lewis








 




 
Featured Javascript Articles

8 ways to build a really bad web site for Search Engines
Some web sites receive hundreds or thousands of unique visitors a day, whilst others only get a handful or none. The reason is often because the web designers or Webmaster has built the site in one 'really bad way' or other. This can end up hindering the ...

Shopping Carts For The Faint Of Heart
The chief criteria for judging an ecommerce shopping cart are the number of credit card processors and shipping services it supports, and the number of people that support *it*.Why? Because credit card processors and shipping services mutate all the time. ...

The Secret Benefit Of Accessibility Part 2: A Higher Search Engine Ranking
An additional benefit of website accessibility is an improved performance in search engines. The more accessible it is to search engines, the more accurately they can predict what the site's about, and the higher your site will appear in the rankings. ...




Optimizing Frames for Search Engines
 
Background

Because of the way framed web pages are created, search engine robots have a difficult time spidering sites built in frames. As a general rule, search engine robots are not very good at executing client-side code, and framed pages are "built" on the client side. The best way to make a website accessible to the robots is to take it out of frames, but what can be done if the site absolutely must remain in frames?

How frames are built

Typically the "framing" page--the page that includes the tags--does not contain any links to the rest of the website; rather, it contains only information necessary for the browser to construct the framed pages.



SuperWidget XYZ from XYZ< itle>






Figure 1--index.html: the "framing" page

The framing page loads the files named in the tags into the frames defined in the framing page. In our example, they look like this:



Navbar< itle>


Page 1
Page 2
Page 3


Figure 2--navbar.html



Page 1< itle>


Welcome to XYZ, home of the new and improved SuperWidget XYZ. We
have the best widgets available anywhere today, and at half the price
of most leading widgets!


Figure 3--page1.html

What if you can't do frames?
Unfortunately, most robots cannot navigate through this page. They do not understand the tags, and are unable to move through this page to the pages "navbar.html" or "page1.html". Without being able to move through here, there is literally nothing of interest for the robot to index, so there will really be no information in a search engine listing, if the site is listed at all.

The section<br /><br />One of the tricks that was incorporated into HTML with the advent of frames was the recognition that a page may be accessed by older browsers that are incapable of rendering framed pages: they literally cannot understand the <FRAMESET> tag. This is why there also exists the <NOFRAMES> tag. This then allows users on browsers that are not frames-enabled to at least see something on a website. Typically, the <NOFRAMES> section is wasted on a message telling the user to get a newer browser, thus:<br /><br /> <br /> <br /> SuperWidget XYZ from XYZ< itle><br /> <br /> <frameset cols="30%,70%"><br /> <frame src="navbar.html" frame="left"><br /> <frame src="page1.html" frame="right"><br /> </frameset><br /> <noframes><br /> This web site must be viewed using a frames-capable web browser. Your<br /> web browser, however, is not capable of displaying frames.<br />

Figure 4--index.html with added section<br /><br />This page now has information that the robot can spider and include in the search engine database. Unfortunately, you will now be known as the website with the content:<br /><br /> This web site must be viewed using a frames-capable web browser. Your<br /> web browser, however, is not capable of displaying frames.<br />Figure 5--search engine listing with poor <NOFRAMES> text<br /><br />Text in <NOFRAMES> section<br />This is probably not what you want your potential visitors to see when they look in the search engine listings. Since the robot can spider at least this page, it only makes sense to put your best foot forward and put some real content into the <NOFRAMES> section. That way, your search engine listing will actually tell something about your site, rather than just annoy people because they choose to use a browser that doesn't do frames.<br /><br /> <br /> <br /> SuperWidget XYZ from XYZ< itle><br /> <br /> <frameset cols="30%,70%"><br /> <frame src="navbar.html" frame="left"><br /> <frame src="page1.html" frame="right"><br /> </frameset><br /> <noframes><br /> Welcome to XYZ, home of the new and improved SuperWidget XYZ. We <br /> have the best widgets available anywhere today, and at half the price <br /> of most leading widgets!<br />

Figure 6--index.html with better text<br /><br />This is a dramatic improvement, because we now have real content on the page that the robot can read and include in the search engine database. You have now upgraded your search engine listing to this:<br /><br /> Welcome to XYZ, home of the new and improved SuperWidget XYZ. We <br /> have the best widgets available anywhere today, and at half the price <br /> of most leading widgets!<br />Figure 7--search engine listing with better <NOFRAMES> text<br /><br />Unfortunately, this is still not enough.<br /><br />Navigation in <NOFRAMES> section<br />Most websites comprise multiple pages. Even though you may have a lot of navigation links in your navbar.html file, the robot will never see it. That means that if you want the robot to crawl the rest of your site, you will need to give it some links in the <NOFRAMES> section of the page. To duplicate the navbar functionality, you will need to add those links to the <NOFRAMES> text, like this:<br /><br /> <br /> <br /> SuperWidget XYZ from XYZ< itle><br /> <br /> <frameset cols="30%,70%"><br /> <frame src="navbar.html" frame="left"><br /> <frame src="page1.html" frame="right"><br /> </frameset><br /> <noframes><br /> Welcome to XYZ, home of the new and improved SuperWidget XYZ. We <br /> have the best widgets available anywhere today, and at half the price <br /> of most leading widgets!<br /><br /> <a href="page1.html" frame="right">Page 1</a><br /> <a href="page2.html" frame="right">Page 2</a><br /> <a href="page3.html" frame="right">Page 3</a><br /><br />

Figure 8--index.html with added hyperlinks

Now you have the best of both worlds: you have text that the robot can grab, and you also have links that the robot can follow to access the rest of your site. As long as you have links to all of the pages on your website that you want the robot to access, you are home free now, search engine-wise. The robot follows the link to the file "page2.html", for example, and indexes the text on that page. How useful this newly-indexed content is to your visitor is now up to you.

Why is site framed?

People use framed sites for a number of reasons: ease in navigation, uniform appearance throughout a site, keeping your company name front-and-center, and so on. In other words, there is probably a reason why you wanted to display the pages on your site (file1.html, file2.html, file3.html) within the frames designated in the "framing" page. Your search engine entries, however, will not keep the pages in this configuration--remember that the robot didn't do frames, so the search engine database knows nothing of frames now either. That means the hyperlink created in the search engine listing will load only the individual page (file2.html), and not put it in its overall context. That's not what you wanted, or you would have designed the site that way!

Loading page into frames

In order to force the user's browser to load a given page into the framed environment that you wanted, you must employ some JavaScript sleight-of-hand. Specifically, you need to make each page aware that it wants to load only within the frames that you have designed. This is a two-step process that involves placing some JavaScript code in each page on the site.

Individual pages

For each of the individual pages, you need to add an awareness whether they are loaded into a frame, or sitting by themselves as an individual document in the browser window. This is accomplished by adding the following JavaScript to the page, typically within the HEAD section:







<br /> Welcome to XYZ, home of the new and improved SuperWidget XYZ. We <br /> have the best widgets available anywhere today, and at half the price <br /> of most leading widgets!<br /><br /> <a href="page1.html">Page 1</a><br /><br /> <a href="page2.html">Page 2</a><br /><br /> <a href="page3.html">Page 3</a><br />

Figure 13--all components placed in "framing" page

Completion

Once you have made these changes for the "framing" page and all of the individual pages, you are now ready for the search engine robots to visit your site. They will be able to access all of the pages in your site, and when your visitors click on your listing in the search engines, your individual pages will load in the way you designed them to work.



About the Author
Dale Goetsch is the Technical Consultant for Search Innovation (www.searchinnovation.com), a Search Engine Promotion company serving small businesses and non-profits. He has over twelve years experience in software development. Along with programming in Perl, JavaScript, ASP and VB, he is adept at technical writing and editing.




Javascript News


TPMCafé

What Gaza means for people in the UK
BBC News, UK - 8 hours ago
Please turn on JavaScript. Media requires JavaScript to play. The recent attack by Israeli planes close to a UN school in Gaza, which left more than 30 dead ...
Video: Gaza Gets a Brief Break AssociatedPress
What's going on in Gaza? Radio 1
Can Egypt broker truce in Gaza once again? Christian Science Monitor
BBC News - BBC News
all 27,703 news articles

Boston Globe

Newsticker requires javascript
Peace fm Online, Ghana - 17 hours ago
The US on Tuesday congratulated Professor John Evans Atta Mills on his victory in the Presidential race. “We commend the Ghanaian people on their resolve ...
Newsticker requires javascript Peace fm Online
Newsticker requires javascript Peace fm Online
Newsticker requires javascript Peace fm Online
Peace fm Online - Peace fm Online
all 809 news articles

Times Online

Apple tunes up Keynote features Video
CNET News, CA - Jan 6, 2009
To play this video, you need Javascript enabled and the latest version of Flash installed. Install Flash now Video description: At Macworld 2009 in San ...
Video: Steve Jobs Weight Loss Due to Hormone Imbalance AssociatedPress
Apple reveals new iPhoto features [video] ZDNet
Apple's Life After Steve Jobs Slashdot
The Mac Observer - IT Examiner
all 2,877 news articles

Newsticker requires javascript
Peace fm Online, Ghana - 7 hours ago
The 5th Parliament of the 4th Republic today unanimously elected Mrs. Justice Joyce Bamford-Addo a retired Supreme Court Judge as the Speaker of the House ...

Voice of America

Newsticker requires javascript
Peace fm Online, Ghana - 13 hours ago
Heads of private sector associations have begun preaching to the incoming government headed by Professor John Evans Atta Mills to put the economy first, ...
Newsticker requires javascript Peace fm Online
Newsticker requires javascript Peace fm Online
Newsticker requires javascript Peace fm Online
Peace fm Online - Peace fm Online
all 76 news articles