我有以下代码:
function ViewItems() {
var liHtml = ''; //Set the variable to nothing
alert($('#categoryselect').val());
$().SPServices({
operation: "GetListItems",
async: false,
listName: "Items",
CAMLQuery: "<Where><Eq><FieldRef Name='Category'/><Value Type="Lookup">" + $('#categoryselect').val() + "</Value></Eq></Where>",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='Image' /></ViewFields>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
liHtml = liHtml + "<h1>" + $(this).attr("ows_Title") + "</h2><br /> <img width=\"150px\" src=\"" + ($(this).attr("ows_Image")).split(", ")[0] + "\" /><br /> <a id=" + $(this).attr("ows_ID") + " class=\"addtobasket\">[Add To Basket]</a>";
});
$("#tasksUL").html(liHtml); //Fill the div with the liHTML
}
});
}在IE中调试时,我得到以下错误:
网页错误详细信息
用户代理程序: Mozilla/4.0 (兼容;MSIE8.0;Windows 6.1;Trident/4.0;SLCC2;.NET CLR 2.0.50727;.NET CLR 3.5.30729;.NET CLR3.0.30729;媒体中心PC 6.0;.NET4.0C;.NET4.0E;InfoPath.3)时间戳:28,2014年3月19日15:27:28
Message: Expected '}'
Line: 74
Char: 77
Code: 0
URI: MY SP Site
Message: Could not complete the operation due to error 80020101.
Line: 2
Char: 2568
Code: 0
URI: /Assets/jquery.js第74行是:
async: false,如果不指定值类型,则不会得到错误,但是查询返回0结果。
发布于 2014-03-20 01:34:06
我认为问题在于:
Type=“查找”
用单引号替换双引号。应该是这样的:
类型=“查找”
https://stackoverflow.com/questions/22510680
复制相似问题