CAML/SPServices/JQuery错误

CAML/SPServices/JQuery错误,jquery,caml,spservices,Jquery,Caml,Spservices,我有以下代码: function ViewItems() { var liHtml = ''; //Set the variable to nothing alert($('#categoryselect').val()); $().SPServices({ operation: "GetListItems", async: false, listName: "Items", CAM

我有以下代码:

            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


    }
    });
    }
第74行是:

async: false,

如果不指定值类型,则不会出现错误,但是查询返回0个结果。

我认为问题在于:

Type=“查找”

用单引号替换双引号。应该是这样的:


Type='Lookup'

不愚蠢。有时我们只需要一双眼睛,特别是在看东西太久之后
async: false,