Problem with getJson on safari (iphone)
I try to execute this code exemple using external webService
-
- $.getJSON('http://domain.fr/testJson/test.json', function(data) {
- var items = [];
-
- $.each(data, function(key, val) {
- items.push('<li id="' + key + '">' + val + '</li>');
- });
-
- $('<ul/>', {
- 'class': 'my-new-list',
- html: items.join('')
- }).appendTo('#home');
- });
the test.json is on a server :
-
{
"one": "Singular sensation",
"two": "Beady little eyes",
"three": "Little birds pitch by my doorstep"
}
It works in chrome but not in safari on iphone, and it doesn't work with phoneGap too.
Nevertheless, it works good when the json file is in local.
How can I fix this bug
Thanks