How to deal with dynamic JSON data using AngularJS?

If I have data that loads using  json / JavaScript will it get indexed by Google?

  • In my source code it's just an empty div: <div id="result"> </ div>

  • Answer:

    No. Personally I dislike sites with content that is only accessible through JavaScript, but if you absolutely insist on doing this you should look in to implementing the Google Ajax Crawling mechanism: http://code.google.com/web/ajaxcrawling/

Simon Willison at Quora Visit the source

Was this solution helpful to you?

Other answers

Option: 1 If you're starting from scratch, a good approach is to build your site's structure and navigation using only HTML. Then, once you have the site's pages, links, and content in place, you can spice up the appearance and interface with AJAX. Googlebot will be happy looking at the HTML, while users with modern browsers can enjoy your AJAX bonuses. You can use Hijax to help ajax and html links coexist.  You can use Meta NoFollow tags etc to prevent the crawlers from accessing the javascript versions of the page. Currently, webmasters create a "parallel universe" of content. Users of JavaScript-enabled browsers will see content that is created dynamically, whereas users of non-JavaScript-enabled browsers as well as crawlers will see content that is static and created offline. In current practice, "progressive enhancement" in the form of Hijax-links are often used. Option: 2 This might be preferable in your situation: In order to make your AJAX application crawlable, your site needs to abide by a new agreement. This agreement rests on the following: The site adopts the AJAX crawling scheme. For each URL that has dynamically produced content, your server provides an HTML snapshot, which is the content a user (with a browser) sees. Often, such URLs will be AJAX URLs, that is, URLs containing a hash fragment, for example http://www.example.com/index.html#key=value, where #key=value is the hash fragment. An HTML snapshot is all the content that appears on the page after the JavaScript has been executed. The search engine indexes the HTML snapshot and serves your original AJAX URLs in search results. In order to make this work, the application must use a specific syntax in the AJAX URLs (let's call them "pretty URLs;" you'll see why in the following sections). The search engine crawler will temporarily modify these "pretty URLs" into "ugly URLs" and request those from your server. This request of an "ugly URL" indicates to the server that it should not return the regular web page it would give to a browser, but instead an HTML snapshot. When the crawler has obtained the content for the modified ugly URL, it indexes its content, then displays the original pretty URL in the search results. In other words, end users will always see the pretty URL containing a hash fragment. The following diagram summarizes the agreement: See more in the....... Getting Started Guide. Make sure you avoid this: http://www.google.com/support/webmasters/bin/answer.py?answer=66355 This is the best resources I have found regarding Google and Javascript http://code.google.com/web/ajaxcrawling/ - This is step by step instructions. http://www.google.com/support/webmasters/bin/answer.py?answer=81766 http://www.seomoz.org/blog/how-to-allow-google-to-crawl-ajax-content Some additional Resources: http://googlewebmastercentral.blogspot.com/2009/10/proposal-for-making-ajax-crawlable.html http://www.seomoz.org/blog/how-to-allow-google-to-crawl-ajax-content http://www.google.com/support/webmasters/bin/answer.py?answer=35769

Taylor Miles

It depends on what kind of content it is and your intent. Can Google interpret some Javascript? Yes Can they do it without special coding (!#) ? Yes Can content that is only loaded by javascript still be included in search results? I have seen evidence that it can. So the decision really comes down to 1. Do you want the content indexed? 2. If you don't want the content indexed, how will Google judge your intent by not allowing it to be indexed? As for accesibility, one option is to have anyone with a cookie, or anyone logged in be served static content.

Andy Beard

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.