So I do in php
$.ajax({
url: 'parser.php',
type: 'POST',
data: 'Data=' + $.toJSON(schedule),
success: function (res) {
alert(res);
}
});
Object that comes to shedule
stdClass object {
weeks => array (1) (
[0] => stdClass object {
0 => stdClass object {}
1 => stdClass object {}
2 => stdClass object {}
3 => stdClass object {}
4 => stdClass object {}
5 => stdClass object {}
6 => stdClass object {}
alltime => (int) 60
}
)
alltime => (int) 60
hours => (int) 60
}
How to pass an ajax request to sharepoint 2010?
And then on the server to parse. Thank you.
This is extremely easy to do with .NET 4.0. From The Rise Of JSON:
Unfortunately SharePoint 2010 is built on top of .NET 3.5 so we can’t use that code.
Instead, to call a web service we can use something like the code described in Getting data from a REST service using C#:
Then we can use the JavaScriptSerializer to parse to JSON response.
The JavaScriptSerializer is a little quirky to work with. If you want something a little more elegant you can use a third-party library like Json.NET to parse the JSON reponse.
I hope this helps,