【发布时间】:2018-07-09 01:38:07
【问题描述】:
我正在开发一个站点,其后端为 django,前端为 jquery。
当调用列表/详细页面 url 时,我将在页面加载时调用 ajax 方法并从后端呈现数据。在backed结果中被django序列化为json数据并渲染回ajax。
例如:
function listFunction(){
$.ajax({
url: '<listing-url>',
type: 'GET',
dataType: 'json',
})
.done(function(response){
// response as json
$.each(response, function(index, value){
$(container).append(value)
});
});
}
$(document).ready(function(e){
listFunction();
});
为了检查我的网站是如何被 google 看到的,我在 google search console 中测试了我的列表页面:
https://www.google.com/webmasters/verification/home?hl=en
我在 Fetch as Google 标签中使用了 Fetch and Render 选项。结果中只加载了页眉、页脚等静态内容,没有通过ajax加载的动态内容显示在结果中。我已经为该站点创建了 站点地图 和 robots.txt。
Seo 对我们的项目非常重要。如何在使用 Fetch as Google 时显示我的动态内容?
如果我在编码部分遗漏了什么,请告诉我。
谢谢。
【问题讨论】:
-
刚才我也用tools.pingdom.com分析了应用。这里的动态内容也没有显示在 html 快照中。
标签: jquery django-rest-framework seo web-crawler bots