简体   繁体   English

我是否应该对网站使用JQuery的load方法,因为Google看不到从该方法加载的内容

[英]Should i use JQuery's load method for my website, as Google does not see content loaded from this method

I have a wesite http://govtjobs.hitechstudent.com . 我有一个wesite http://govtjobs.hitechstudent.com In this website i have a HTML template, and in this template i used JQuery's load() method which after html loading, access a PHP Script which puts data in HTML skeleton. 在这个网站上,我有一个HTML模板,在这个模板中,我使用了JQuery的load()方法,该方法在html加载后访问一个PHP脚本,该脚本将数据放入HTML框架中。 My Problem is it that google does not see the content loaded from PHP script, so nothing gets crawled. 我的问题是,谷歌没有看到从PHP脚本加载的内容,因此没有任何内容被抓取。 What should i do? 我该怎么办? Is there any other better approach i should use instead of mine. 我还有其他更好的方法可以代替我的方法吗? Java Script Code: Java脚本代码:

    $(document).ready(function(){
    $('#govtjobs').load("resources/script/govtJobProvider.php);
    });

Please Help 请帮忙

I recommend this post: http://seogadget.com/javascript-framework-seo/ 我推荐这篇文章: http : //seogadget.com/javascript-framework-seo/

In any case make you site fully crawleable is a very hard work. 无论如何,要使您的网站完全可爬网是一项非常艰巨的工作。

You can use AJAX for this purpose , here is the code: 您可以为此使用AJAX,这是代码:

$.ajax({
           url: "resources/script/govtJobProvider.php",
           type: "GET",
           dataType: "html",
           success: function(html) 
           {
               //here you have complete response in **html**
               $("html").html(html);
           }
      });//end ajax call

Hope this helps. 希望这可以帮助。

Most crawlers, including Google simply ignore and don't run Scripts. 包括Google在内的大多数爬网程序只是忽略并且不运行脚本。 Therefor it's no wonder that Google can not find the content loaded from an ajax function. 因此,难怪Google找不到从ajax函数加载的内容。

Maybe you can do: 也许你可以做:

  • add more keywords to your head according to content of your govtJobProvider.php 根据govtJobProvider.php的内容在您的头上添加更多关键字
  • hidden div containing stuff (pretty dirty and idk if crawlers ignore these contents) 包含内容的隐藏div(如果抓取工具忽略了这些内容,则非常脏和idk)
  • simply don't use ajax for content that should be crawled 只是不要对要爬网的内容使用ajax
  • etc. 等等

Sorry, cant catch more of em atm coffee . 抱歉,不能再喝更多的ematm 咖啡 Maybe you can try using this nice article: http://www.thesitewizard.com/archive/google.shtml 也许您可以尝试使用这篇不错的文章: http : //www.thesitewizard.com/archive/google.shtml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM