Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone mobile safari JSON parse error

I am using php json_encode to encode arrays of objects and storing them in a hidden div. Then using jquery.parseJSON to put them into js arrays of objects to work with. I am using jQuery v1.7. The exact error is JavaScript Error on Line 2: SyntaxError: Unable to parse JSON string. This error only occurs on the mobile version of safari. FF, Chrome, IE Safari and android all work, it only pulls this error with mobile safari. Any thoughts?

like image 428
user1174495 Avatar asked Mar 05 '26 05:03

user1174495


1 Answers

After eliminating different fields, I discovered the problem was only in phone numbers. The automatic detection of phone numbers either interfered with json or json interfered with the detection of phone numbers. Adding <meta name="format-detection" content="telephone=no"> solved the error.

like image 79
user1174495 Avatar answered Mar 07 '26 17:03

user1174495



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!