An ASP.NET Ajax SEO Idea

This is my first post on here so I hope it is helpful.

I was playing around with an idea of making a site where the content was loaded into the page with ajax. So I changed my links to LinkButtons and made these pass the ID of the page to load.

After getting this running I thought to myself, using these link buttons I have just hidden all my content from any search engine as the LinkButton's href attribute is a javascript call and a searchengine will not be able to follow this. Then I came up with an Idea, wh not change the link so that the normal href would pass a query string with the id to the page to load this way if the user has javascript off or a search engne is crawling the site they will still be able to see the content, and if the user has javascript on they will get the ajax based version of the site.

To this this I did the following things:

1. Set the href attribute to be the non ajax version of the page i.e. page.aspx?ID=x
2. Add an onclick attribute which would be the javascript postback, which inturn would use the ajax based version of the page.
3. On the page load check to see if the ID is passed in as a query string and if so load the content.
4. Handle the onclick of the LinkButton to load the content using AJAX.

An issue with this is that by adding a secound href attribute there are now two, the original javascript one and the new url based one, I dont think this is ready just yet for use, but I will be making a new SEO friendly link button control soon.

 

Hope you find this useful, any feedback would be good.

Cheers

Stefan Sedich

6 Comments

  • I think I labeled the post wrong it should have been an Accessibility Idea. What does black collar mean?

  • this is callled cloaking and get will get yo ubanned from google

  • So you are saying that a link with an onclick to say perform an animation or something else will also be seen as cloaking?

  • You could be doing something like this for completely genuine purposes too... onClick() for browsers that support javascript and a regular href for the rest.

    Whats cloaking about it ?

  • Hello,

    I thought this too, I am being 100% genuine in being able to provide my users with a accessible website. I am not hiding anything here or being shifty :P. I have heard about cloaking and I may need to read up on it to make sure, but if this is the case thats just crazy.

    Thanks
    Stefan

  • looking forward to the time when SEs can simply follow the javascripts and examine the resulting dom. maybe a good idea to write my own not so stupid SE.

Comments have been disabled for this content.