jquery load() and SEO - anyone got a decent answer?

余生长醉 提交于 2019-12-04 01:09:32

问题


Many aspects of my site are dynamic. I am using jquery.

I have a div which once the DOM is ready is populated using load().

Then if a button is clicked, using load() once again, this value is replaced by another value.

This kind of setup is common across my site. My homepage is essentially lots of dynamically loaded, refreshed, and changeable content.

What are the repercussions of this for SEO?

Ive seen sites where each page is loaded using load() and then displayed using the animation functions... It looks awesome !

People have posed this question before, but noone has answered it properly.

So any ideas? JQUERY AND SEO??

Thanks

EDIT

Very interesting points. I dont want to overdo my site with jaascript.. just where neccesary to make it look good - my homepage however is one place of concern.

So when the DOM is readY, it loads content into a div. On clicking a tab, this content is changed. I.E No JS, No content.

The beauty here for me is that, there is no duplicated code. Is the suggestion here that i should simply 'print' some default content, then have the tabs link to pages (with the same content) if JS is disabled. I.E sacrifice a little duplicate code for SEO?

As far as degrading goes, my only other place of concern is tabs on the same page.. I have 3 divs, all containing content. On this page two divs are hidden until a tab is clicked. I used this method first before i started playing with JS. Would it perhaps be best to load() these tabs, then have the tab buttons link to where the content is pulled from?

Thanks


回答1:


None of the content loaded via JavaScript will be crawled.

The common and correct approach is to use Progressive Enhancement: all links should be normal <a href="..."> to actual pages so that your site "makes sense" to a search spider; and the click() event overrides the normal functionality with load() so normal users with JavaScript enabled will see the "enhanced" version of your site.




回答2:


If your content is navigable when JavaScript is turned off, you'll be a good ways toward being visible to search engines.

Note that search engine crawlers won't be submitting any forms on your site, so if you have any or elements that are meant to be navigating between your site's content pages, that content is not navigable by search engines.




回答3:


Here is a guidelines how to make Google to crawl content loaded with ajax: http://code.google.com/web/ajaxcrawling/docs/getting-started.html




回答4:


I use jquery load() asynchronous page load. It greatly improves user experience, but not seo-friendly. Here's the only solution I have found so far:

  1. On first load I do not use jquery load() and try to write cookie with javascript.document.cookie = 'checkjs=on';

  2. On next page load if php script finds this cookie it means that javascript is enabled and jquery load() can be used. If there's no such cookie then javascript is off (probably spider came), so jquery load() is not used.

    if (!$_COOKIE['checkjs'] || $_COOKIE['checkjs']!='on'){echo 'js is off, hello Google!'; } else {echo 'js is on, can use jquery load';}

This way I can be sure that most of users can benefit from asynchronous page blocks load, exept for the very first load. And spiders get all content too.

In your case you could just load the same page with new parameter that makes another tab active. Spider is gonna be happy.



来源:https://stackoverflow.com/questions/3693244/jquery-load-and-seo-anyone-got-a-decent-answer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!