I'm getting some data via jsonp, which is just served locally at the moment. All works fine except if I turn off the server - "Failed to load resource: net::ERR_CONNECTION_REFUSED" appears in the console after 3 seconds, but I cannot catch the timeout using the datasource error event.
var
_dsRawDataBundle =
new
kendo.data.DataSource({
offlineStorage:
'kui_raw'
,
transport: {
read: {
url:
'http://localhost:5000/datasets/1/rawData'
,
dataType:
'jsonp'
}
},
change:
function
(e) {
var
data =
this
.data();
console.log(
'Got livestock raw data bundle: '
+ JSON.stringify(data));
},
error:
function
(e) {
// Not being called on timeout
console.log(
'Reading raw data failed: '
+ e.status);
}
});
Regards,
Steve
7 Answers, 1 is accepted
There is no error handling for JSONP requests, however you can try explicitly specifying the timeout option. For example:
Regards,
Alexander Popov
Telerik
thanks, the error function is called when the timeout is explicitly set.
You said "There is no error handling for JSONP requests". Does this mean I cannot expect the code shown in http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.errors to work when using jsonp?
That is correct. Setting a timeout will trigger the error event, however the error will always be "timeout". This behavior is not related to Kendo UI and I am afraid there is no good solution or a workaround that we can suggest.
Regards,
Alexander Popov
Telerik
Regards,
Steve
I have a problem with Kendo UI when I click this link the demo keeps loading and never stop. So, I hit F12 and see errors below at console tab. Do anyone have any idea?
Failed to load resource: net::ERR_CONNECTION_REFUSED
kendo-ui:209 Uncaught TypeError: Cannot set property 'browser' of undefined
kendo-ui:713 Uncaught TypeError: $ is not a function
(program):1 Uncaught TypeError: b is not a function
kendo-ui:920 Uncaught TypeError: $ is not a function
kendo.custom.min.js:1 Uncaught TypeError: Cannot read property 'extend' of undefined
live-edit.min.js:6 Uncaught TypeError: Cannot read property 'Widget' of undefined
kendo-ui:1293 Uncaught TypeError: $ is not a function
kendo-ui:1375 Uncaught TypeError: $ is not a function
kendo-ui:1436 Uncaught TypeError: $ is not a function
kendo-ui:1536 Uncaught TypeError: $ is not a function
kendo-ui:1683 Uncaught TypeError: $ is not a function
Telerik.Web.UI.WebResource.axd:1370 Uncaught TypeError: Cannot read property 'migrateMute' of undefined
jQuery.Validate.min.js:13 Uncaught TypeError: Cannot read property 'extend' of undefined
all.min.js:1 Uncaught TypeError: $ is not a function
kendo-ui:1782 Uncaught ReferenceError: Web is not defined
www.googletagmanager.com/gtm.js?id=GTM-6X92:51 Uncaught #<Object>
This seems to be caused by a network issues. Please, check if the issue persists and if there are any scripts that failed to load as well.
Regards,
Alexander Popov
Telerik