Crikey Mikey Crikey Mikey - 1 month ago 11x
jQuery Question

Returning a JSON object from PHP to ajax not working on IOS

I'm returning a JSON object from PHP to ajax. This works fine on all devices except for iPhone IOS. For some reason on IOS (chrome and safari) instead of the object being passed back to ajax, the JSON object is displayed instead of my webpage.. (on a blank white screen)

{"key":"value", etc }




url: $form.attr( 'action' ),
type: $form.attr( 'method' ),
data: ajaxData,
dataType: 'json',
cache: false,
contentType: false,
processData: false,
success: function( data ) {

// something


Sorry people, i didnt give you all the pieces of the puzzle. Looks like the following code was breaking my JS on IOS:

$("input[type=radio").change(function() {

IOS may not support input[type=radio] so i just made a class instead :|


Replying on a real answer:

You forgot the closing bracket on your jQuery selector.

It should be:

$("input[type=radio]").change(function() { $($errorMsg).removeClass('error'); $($errorMsg).hide(); });

Thank me later :)