-
Notifications
You must be signed in to change notification settings - Fork 323
Open
Description
On https://dexie.org/docs/Dexie/Dexie.on.populate#ajax-populate-sample
return new Promise(function (resolve, reject) {
$.ajax(url, {
type: 'get',
dataType: 'json',
error: function (xhr, textStatus) {
// Rejecting promise to make db.open() fail.
reject(textStatus);
},
success: function (data) {
// Resolving Promise will launch then() below.
resolve(data);
}
});fetch() is supported on all browsers that support IndexedDB, using jquery in the documentation makes this library seem a bit "old-school", back when jquery was used to harmonize all the different ways ajax calls were made.
I think developers may simply cut and paste when getting started, so using something that works everywhere and was also a best practice for handling errors would be better than requiring jQuery.
Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status