I am in the middle of building this website for mobile/iphone well everything seemed to be going all ok, built a page using json data using the getJson function all ok on my 3G iphone, but when viewed on my colleague iphone 4, the code did not show?
There was no error nothing just did not run the code within the getJson function.
MY CODE:
- //-- this log will show on both iphone 3G and 4
- console.log('begin json ');
- //-- the log and code within will not show in iphone4 safari mobile but iphone 3g all ok
- $.getJSON('http://url/myjsonfile.json?callback=displayfile', function(n) {
- console.log('Json Loaded');
- //-- display list
- for($i=0; $i<n. info.length; $i++){
- var $r=n.info[$i]. title;
- $('#info-container').append('<a href="link.asp?id=' + $i + '" rel="external">' + $r + '</a><br />');
- }; //-- end loop
-
- });//-- end json
MY JSON FILE (myjsonfile.json)
(this is a fiel its not generated via php/aps ect)
- {"info": [
- {
- "title": "TITLE GOES HERE",
- "content": [
- {
- "text": "Text to go here",
- "img": "image.jpg",
- "imgby": "artist"
- }
- ]
- },
- {
- "title": "TITLE GOES HERE",
- "content": [
- {
- "text": "Text to go here",
- "img": "image.jpg",
- "imgby": "artist"
- }
- ]
- },
- {
- "title": "TITLE GOES HERE",
- "content": [
- {
- "text": "Text to go here",
- "img": "image.jpg",
- "imgby": "artist"
- }
- ]
- }
- ]
- }
I have also tried this in a basic html page with just jquery and a little code no jquery mobile etc and still, ok on my 3G phone not in iphone4, also other browsers are ok as well.
Many Thanks
SI