Welcome to WebmasterWorld Guest from 54.147.20.131

Forum Moderators: open

Message Too Old, No Replies

Need a SEO workaround for a AJAX product matrix

products are not getting spidered

     

dchamp

10:25 pm on Jul 12, 2010 (gmt 0)

5+ Year Member



Hello,

I have a site that calls or paginates with an AJAX call so there's no way that the spiders are getting into the product level with a normal crawl. Is there an onpage workaround that I can use to increase the spiderability? I know I can use an XML site map but I'm looking for other ideas.

Thanks!

daveVk

12:16 pm on Jul 13, 2010 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member




By far the best solution is to rework the design so that it works with javascript disabled and use ajax only used to enhance it.

A partial workaround is to put links to ajax content within noscript tags, but this indexes the bare ajax pages, so if these are visited you need some script to get the ajax back into its intended context.

lostdreamer

12:59 pm on Jul 13, 2010 (gmt 0)

5+ Year Member



Rule 1 in javascript: Use javascript that degrades gracefully.

How many times I have visited a site that forced me to turn on javascript for the smallest things....

Normally I would use a href tags to link through the 'normal' pagination, and have them replaced (by js) with buttons that will paginate through ajax calls.

rocknbil

6:31 pm on Jul 13, 2010 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



What do your links look like? If you've implemented the Ajax correctly, you should have something like this.

<a href="some_script.php?page=2" onclick="return some_function(this.href);">product one</a>

Return false from "some_function" and if JS is disabled, it will follow the href. If you have

<a href="#" onclick="some_function('products','2');">product one</a>

or

<a href="javascript:some_function('products','2');">product one</a>

or

<a href="javascript:void()" onclick="some_function('products','2');">product one</a>

You have a problem. At any rate, you may just need to change the links and add return false from your functions.

enigma1

11:20 am on Jul 18, 2010 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



IMO, if the ajax is implemented correctly the links will look like:

<a href="some_script.php?page=2" class="some_class">product one</a>

No js handlers mixed with HTML. The only hook will be onready and even that I would prefer to see it as separate function call at the end of the HTML code so you don't bloat the page with js code the actual content.

The framework should have a modular structure so if js is off the server generates the full page on a link click. Otherwise the ajax retrieves from the server just the HTML to update in the page.

This is totally transparent to spiders.

dchamp

2:36 pm on Sep 16, 2010 (gmt 0)

5+ Year Member



You all rock!

httpwebwitch

12:56 pm on Sep 17, 2010 (gmt 0)

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member



supplemental note:

always build your entire site with JavaScript turned off, so it is 100% navigable without executing script. Then - when everything is finished - add the AJAX features. These extra behaviours should be added using only external JS files, hooking onready (or onDomReady) -- like enigma1 said.

It's called progressive enhancement, and it ensures that your site is accessible & crawlable and indexable.

Tiggerito

4:59 am on Sep 18, 2010 (gmt 0)

5+ Year Member



Google have proposed and implemented a solution to help them index AJAX based websites. I've experimented with it here: < sorry, no self-promotion >

It enables you to tell Google about page fragments (e.g. your dynamic products) and Google can directly send people to those fragments via a URL it indexes.

[edited by: tedster at 9:33 pm (utc) on Sep 20, 2010]

 

Featured Threads

Hot Threads This Week

Hot Threads This Month