Reputation: 31
When I try to bind this Remote JSON array
[{"id":1,
"title":"Test 1",
"description":null,
"start":"2018-07-13T00:00:00",
"end":"2018-07-13T01:00:00",
"startTimezone":null,
"endTimezone":null,
"recurrenceId":null,
"recurrenceRule":null,
"recurrenceException":null,
"isAllDay":false},
{"id":2,
"title":"Test 2",
"description":null,
"start":"2018-07-13T03:00:00",
"end":"2018-07-13T04:00:00",
"startTimezone":null,
"endTimezone":null,
"recurrenceId":null,
"recurrenceRule":null,
"recurrenceException":null,
"isAllDay":false}
]
via
var dataSource = new kendo.data.SchedulerDataSource({
transport: {
read: {
url: "https://localhost:44346/api/xxxxx",
dataType: "jsonp",
complete: function(jqXHR, textStatus) {
console.log(textStatus, "read")
}
},
}
});
textStatus results in 'parsererror'
Any suggestions/help welcome!
Thanks Alan Painter
Upvotes: 1
Views: 202
Reputation: 27508
JSONP
is used when the server will deliver json
data in the form callback_function(the-json). This feature is used when the server will be delivering information to requests from clients referring from a different server. Without using JSONP those types of requests will get an error.
See
If your server is returning json data directly to a page already being served by it, try datatype:'json'
. The lack of a jsonp
value being sent back indicates the service routine is not examining or honoring the inbound dataType
specified.
Upvotes: 1