Form submition with jQuery is not working correctly with IE8

后端 未结 5 1586
广开言路
广开言路 2021-01-24 09:40

jQuery $.ajax() does not seem to work correctly with IE8 but it is working with Firefox, Chrome and Safari. I am submittin the form and response back in JSO

5条回答
  •  情书的邮戳
    2021-01-24 10:03

    Your JSON response (output of _test.php) should contain : instead of ;, as @sje397 said. Seems like other browser are okay with ;, but not IE8, so the value is kept a string instead being parsed as an object.

    EDIT: for some reason your data isn't being converted to json, try putting

    if(typeof(data)=='string') {
      data=$.parseJSON(data);
    }
    

    at the top of your success handler and see if it works.

提交回复
热议问题