質問

there is a website that is only for responding to ajax requests this is the code on another website

$.ajax({
      dataType: 'jsonp',
      url : 'http://www.somedomain.com/getdata',
      data: 'parametr=value',
      jsonp: 'js_callback',
      success: function() {
        // Do your stuffs on
       alert("Successfully requested cross domain with jquery ajax");
      }
});

phpcode on somedomain.com :

function do_something() {    
   $data = array();
   $data  = getuserDataBYID($_GET['userid']);
   echo $_GET['js_callback']."(".json_encode($data).");";
}

does that effects alexa rank of somedomain.com ?

役に立ちましたか?

解決

Alexa is an analytics service. When dealing with AJAX, what you really want to know is how AJAX affects SEO (search engine optimization). To my knowledge, Alexa's tools will not necessarily know in what way your AJAX calls are hiding data from crawlers or what that data is. Crawlers generally do not see the effects of javascript (like ajax calls), but only the page source. To see a page like an SEO crawler would see it, you can right click on a page and select "View Source". If all of a site's content is delivered by ajax, then the page appears mostly blank to web crawlers (like google). In that case, Alexa should be warning you that you basically have no content. Your SEO score would certainly be terrible. If most of your content is delivered by the server on page load, then the best practice is to only load things via ajax that are not essential to your SEO score. If important content is loaded with ajax, you'll need to route crawlers to html snapshots of your page so that they get an accurate view of your site's content.

You can create html snapshots of your site manually or with a headless browser like PhantomJS running on your server. PhantomJS is nice because it can crawl a site and capture javascript output. You could schedule it to crawl the site everyday and save each page's generated html.

Here is the google guide to routing crawlers to snapshots: https://developers.google.com/webmasters/ajax-crawling/docs/getting-started

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top