Can't get GetListItems working in Internet Explorer 7
-
29-11-2019 - |
質問
In the below code, I'm using SPServices library to get a list item's author's name.
$().SPServices({
operation: "GetListItems",
async: false,
listName: "MyList",
CAMLViewFields: "<ViewFields Properties='True' />",
CAMLQuery: "<Query><Where><Eq><FieldRef Name='ID' /><Value Type='Integer'>" + id + "</Value></Eq></Where></Query>",
completefunc: function (xData, Status) {
$(xData.responseXML).find("[nodeName='z:row']").each(function() {
alert($(this).attr("ows_Author")));
});
}
});
Only in IE7 and IE8, it returns null. $(xData.responseXML).find("[nodeName='z:row']").length equals to 0. In other browsers it works fine.
Any ideas?
解決 2
Turns out IE7 recognizes my site's URL different than the other browsers. Re-creating the site solved the problem.
他のヒント
Have you posted this on the SPServices forum on Codeplex (spservices.codeplex.com)?
I've never tried to use the Properties='True' attribute for ViewFields with SPServices. Do you get the same behavior if you remove that? The rest of your script looks correct.
所属していません sharepoint.stackexchange