Jump to content

SEO with AJAX content?


f1r3fl3x

Recommended Posts

Hi,

I'm really new at seo, so i wonder if my idea will be friendly or not.

Here's my idea:

I have a webpage that loads content dynamically via ajax calls.

The part i wonder is this. I'm going to make the href of the link like this: http://site.com/articles/article1.html

and a onClick event that loads the content into the div container (getcontent.php?article=article1).

The ajax response will have the same content as the href link, but without the design just the text.

This will make the user experience much better, but will it affect seo :confused:

Link to comment
Share on other sites

To be honest it would probably be better for SEO, since there's no design features clogging up the mark-up. However those are the pages the search engines will index, and of course, that's where the user will be taken; content only pages.

Link to comment
Share on other sites

Ajax does not work for SEO! At all!

Google cannot interprit javascript, nor will it look at javascript. If /articles/article1.html is spidered this is the url that will be indexed, not the page that is making an ajax call to get content from this source.

Search engines spider content that is read from the HTML source. If the content is not visible within the HTML source it is not visible to a spider.

 

Take a look at this tool to see what your pages look like as a spider

http://www.smart-it-consulting.com/internet/google/googlebot-spoofer/

 

Or use the firefox tool

http://www.seoforclients.com/blog/marketing/seo/how-to-browse-and-check-like-google-bot.html

Link to comment
Share on other sites

I think he was meaning to provide a 'href' link for the search engines / JS-disabled users to follow, which would mean the content got indexed, and for the rest call the onclick event (but return false to stop the browser following the link).

Link to comment
Share on other sites

I think he was meaning to provide a 'href' link for the search engines / JS-disabled users to follow, which would mean the content got indexed

Would the page containing the content still have the navigation that is required to browse the site. If these pages get indexed they are the pages that users will be landing on.

 

Using AJAX to display content with DOM that is important for SEO is a really bad idea. Why not load the content onto the page from the start (not with AJAX, i.e. sql query) and just use the DOM to hide it from users until an event handler is clicked. The fact that the content will still be viewable in the HTML source makes it SEO friendly.

Link to comment
Share on other sites

Would the page containing the content still have the navigation that is required to browse the site. If these pages get indexed they are the pages that users will be landing on.

 

Yeah that was my point here...

 

However those are the pages the search engines will index, and of course, that's where the user will be taken; content only pages.

Link to comment
Share on other sites

Heh no worries. There is a solution though 'f1r3fl3x'. When you make the AJAX request add a parameter to the URL, something like "ajax=1", which within your code you can then use to determine whether or not apply the design. Obviously then the search engines will take them to the design in-tact version, and the AJAX request will only return the content.

Link to comment
Share on other sites

When you make the AJAX request add a parameter to the URL, something like "ajax=1", which within your code you can then use to determine whether or not apply the design. Obviously then the search engines will take them to the design in-tact version, and the AJAX request will only return the content.

You are talking about basic cloaking. This would work by determining the user agent.

Link to comment
Share on other sites

Thanks for the replies guys!

But i think you didn't understand me :/

I really can't describe my idea very good becouse i'm not english :D

But code is universal and i'll show you what i tried to describe in my previous post :)

 

article108.html //using mod_rewrite to make urls more friendly

 

 //Design and stuff
<div id="content">
This article is about bla bla bla bla ...
There's an artical that's related to this one. Here's the LINK.
</div>
//design and stuff

 

And the link is this

 

<a href="article1123.html" onClick="loadArticle(1123);">

 

The bots, as you said ignore javascript. So they will follow the link article1123.html,

which is a page of the site like any other with design, navigation and the content of the article.

 

article1123.html

 

//design and stuff
<div id="content">
this is the content of article 1123....
</div>
//design and stuff

On the other hand the users, when they click on the link the js event will be fired,

the next article will be dinamycally loaded in the content div

So in theory this will work. The users will quickly load the articles via ajax+json calls, and

the bots will index pages normaly, without knowing that there's a dynamic content on the page.

I hope you understood what my idea is this time and i'll be glad to discuss the issues in this method  :)

Link to comment
Share on other sites

  • 4 weeks later...

Google can follow javascript links now. It is evolving guys keep up :)

OK, but if i make all the links with an id, and then when the page loads i add the onClick event dynamically would google follow that link?

I think it wont, becouse google can't read javascript, or i'm wrong ?

Link to comment
Share on other sites

so... i take it sql queries are readable by web-crawlers?

 

Is it possible to make Ajax SEO friendly w/o having a physical .html file where the articles reside?

 

Take wordpress or Joomla for example.  I know wordpress does not store individual blog entries like this - and to my knowledge neither does Joomla.  Joomla is (somewhat) SEO friendly if installed and configured properly.  Pretty sure blog posts are SEO friendly through wordpress.

 

I realize this is probably difficult to achieve... but if sql queries are SEO friendly it seems like having the directory (and the individual articles) are a bit unnecissary.  Theoretically, (again, assuming sql queries are able to be read by crawlers) one could create an articleIndex.php file which queries all of the articles in a mysql table... right?

 

Not sure though... could be off base - in which case, how are joomla/wordpress/whatever CMS SEO friendly? 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.