Je vais avoir des problèmes avec jQuery dans PhoneGap, le problème est quand je charge un fichier en utilisant .json
$.get("file.json")
, normalement il retournera toutes les données sérialisé comme un objet, mais dans mon application je viens obtenir une chaîne plate.
Alors, que se passe-t-il? Phonegap manque-t-il un type mime pour json ou?
$.get("file.json").done(function(data){
typeof data // string
// I can fix it like this, but I'll rather have the default behavior
// of jquery.
data = (typeof data == "string") ? JSON.parse(data) : data;
});
Il travaille :) mais je devais le faire comme ceci: .get $ ("file.json", la fonction (données) {}, "JSON"); – winthers