PhoneGap iPhone: how to pass back an array of JSON objects using the PluginResult API
I need to pass back an array of JSON
object in the similar to the following way,
From iPhone's plugin to the JavaScript
side using the Successful callback mechanism on PhoneGap 1.0.0.
I have success on passing back 1 single JSON object but cannot find out how to do any array. Any idea? Thanks ahead.
[ {name: "abc"开发者_如何学Python, number: 1234567890}, {name: "xyz", number: 9876543210} ].
You could try passing it back to the JavaScript as an actual JSON string and parsing it there?
var onSuccess = function(data) {
var incomingData = JSON.parse(data);
// do something with incomingData...
};
精彩评论