【发布时间】:2013-07-14 23:22:18
【问题描述】:
在我正在处理的网站上,我们有一堆 jquery,它们根据在选择选项中选择的内容重定向到页面的下一级。更改功能工作正常,但谷歌网站管理员工具无法正确读取代码,并在 GWT 中返回一堆 404 错误。
var type = $('#select-type option:selected').attr('value') ;
if (type == 'Masters' || type == 'Bachelors' || type == 'Associates')
{
location.href = '/'+type+'/Degree-in-Criminal-Justice';
}
GWT 为 /Degree-in-Criminal-Justice 返回 404 错误,并忽略类型变量,它是有效 url 的一部分。
【问题讨论】:
-
首先,你应该使用:
var type = $('#select-type').val()
标签: jquery seo googlebot google-search-console