SPServices not working
Posted: 05 Apr 2016
Hello,
I added watermark text using the example from the forum (works great) however adding the watermark text has cause SPServices to no longer work. What do I need to change to get SPServices working again?
Thanks
window.$ = $;
window.jQuery = $;
RegisterSod('watermark.js', '/SiteAssets/js/jquery.watermark.min.js');
LoadSodByKey('watermark.js', null, true);
fd.field('Extension').control()._el().find('textarea').watermark('Example: ');
fd.field('Status').control()._el().find('textarea').watermark('Examples: ');
var query = "<Query><Where><Eq><FieldRef Name='Author' LookupId='TRUE' /><Value Type='Integer'><UserID Type='Integer'/></Value></Eq></Where></Query>";
window.$().SPServices({
operation: "GetListItems",
async: false,
listName: "Closing",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
CAMLRowLimit: 1,
CAMLQuery: query,
completefunc: function (xData, Status) {
totalItems = parseFloat(window.$(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount"));
alert('here ' + totalItems);
if (totalItems > 0) {
window.$(xData.responseXML).SPFilterNode("z:row").each(function () {
});
}
}
});
I added watermark text using the example from the forum (works great) however adding the watermark text has cause SPServices to no longer work. What do I need to change to get SPServices working again?
Thanks
window.$ = $;
window.jQuery = $;
RegisterSod('watermark.js', '/SiteAssets/js/jquery.watermark.min.js');
LoadSodByKey('watermark.js', null, true);
fd.field('Extension').control()._el().find('textarea').watermark('Example: ');
fd.field('Status').control()._el().find('textarea').watermark('Examples: ');
var query = "<Query><Where><Eq><FieldRef Name='Author' LookupId='TRUE' /><Value Type='Integer'><UserID Type='Integer'/></Value></Eq></Where></Query>";
window.$().SPServices({
operation: "GetListItems",
async: false,
listName: "Closing",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
CAMLRowLimit: 1,
CAMLQuery: query,
completefunc: function (xData, Status) {
totalItems = parseFloat(window.$(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount"));
alert('here ' + totalItems);
if (totalItems > 0) {
window.$(xData.responseXML).SPFilterNode("z:row").each(function () {
});
}
}
});