I am created myself a custom list with sharepoint 2007, which is exactly the same as any excel spreadsheet in effect.
I was told that i can get this out all of the information as a json or XML object. I don't have access to the file system, only to sharepoint web interface.
Can i just use a url and do my normal getJson
?
$.getJSON("http://somesharepointurl.asp?get=json",function(results){
console.info(results);
$.each(results, function(){
});
});
Or is there no way of doing this without writing some backend service?
Edit
https://someserver/sites/DisasterRecovery/eventmgmt/DRR/_vti_bin/owssvr.dll?Cmd=Display&List={B0ACA997-8A41-498B-97FE-B276D48F64D7}&XMLDATA=TRUE
I have tried this... it gave me this:
HTTP/1.1 200 OK
Server: Microsoft-IIS/7.5
Date: Fri, 14 Dec 2012 11:41:55 GMT
Connection: close
No idea what to look for whatsoever i'm afraid :(
Found the simple answer:
jquery.SPServices
you will need jQuery 1.4.2+ to run this but its fantastic :) It has many more method's than just getting XML or json back.
var query = "<Query><OrderBy><FieldRef Name='Created' Ascending='False' /></OrderBy</Query>";
$().SPServices({
operation:"GetListItems",
async:false,
listName:"Home Page Carousel",
CAMLViewFields:"<ViewFields><FieldRef Name='userName'/><FieldRef Name='userDepartment'/><FieldRef Name='message'/></ViewFields>",
CAMLQuery:query,
CAMLRowLimit:10,
completefunc:function (xData, Status) {
console.info(xData);
console.info(Status);
$(xData.responseXML).SPFilterNode("z:row").each(function () {
var $this = $(this);
$this.attr("ows_message")//retrieve list data here and do stuff here
});
}
});
This will return you a lovely chunk of XML .
Another option, in sharepoint 2010 try use the OData like these : http://webname/_vti_bin/ListData.svc/listname
, and the feature of filter and sort is same as standard OData, refference can be found here: http://www.odata.org/documentation
Try to add &Query=* to the URL query string