Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Sharepoint 2010 SpServices and JQuery Mobile

$
0
0

So I am make a mobile page for a certain list in my SharePoint 2010 site using jquery mobile. I am using SPServices to get the list items I want displayed. I run some console.log to see what has been happening and basically the xData.response.XML is coming up undefined in the console log but the xData.response.TEXT shows me everything in my list that I want.

What is the reason for this and can I fix this? I am hoping SPServices in itself is not battling to communicate with the jquery mobile stuff.

Thank you, SPServices code below.

function getListItems() {
 var caml = "<Query><OrderBy><FieldRef Name='Created' Ascending='False' /></OrderBy></Query>";

 $().SPServices({
    operation: "GetListItems",
	listName: "Announcements",
	webURL: "http:///win-0q7isbhddou/sites/mobile",
    async: true,
	CAMLRowLimit: 15,
	CAMLQuery: caml ,
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
    completefunc: function (xData, Status) {
		console.log(Status);
		console.log(xData.responseXML);
		console.log(xData.responseText);
      $(xData.responseXML[0]).SPFilterNode("z:row").each(function() { 
			var html = "<li><a href=\"#\"><h2>" + $(this).attr("ows_Title") + "</h2></a></li>";
                    $("#listviews").append(html).listview("refresh");;
                });
  }       
	}); 
  }  //end function

I get the following for these...

console.log(Status); ---> "Success"
console.log(xData.responseXML); ---> 'undefined'
  console.log(xData.responseText); ---> Basically get all the list items here

Thank you


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>