php - jQuery $.ajax POST Request with IE 9 results empty array -
i have problem coding, in firefox works fine in ie9 works first ~5 seconds. after time don't receive post data anymore.
i want load php page via ajax using values of form inputs post variables. first 5 seconds can receive post on requested page after receive empty string.
here code:
function reload_form(){ var data = $("#formularfelder").serialize() $.ajax({ type: 'post', url: 'content/formular.php', data: data, success: function(msg) { $("#form_container").html(msg); } }); }
is bug of ie9 , there workaround available?
it awesome if me! :)
******edit****
i found reason issue @ post:
why internet explorer not send http post body on ajax call after failure?
ie runs keep-alive timout , doesn't send body within post data anymore.
to workaround problem send packet in regular time intervalls (equal keep-alive timeout) server keep keep-alive. cause little bit traffic (~200 bytes per refresh) it's still more practicable workaround disabling keep-alive in apache.
this solution found problem
for same problem here's refreshing code keep-alive timeout of 5 seconds:
var updatediv = function () { $.ajax({type: 'post', url: 'timeout.php'}); yourtimer = window.settimeout(updatediv, 5000); } $( document ).ready(function() { var yourtimer = window.settimeout(updatediv, 5000); });
- please change jquery version. faced same problem in ie9 when use jquery.js version 1.10. when try version 1.8 problem solved.
or
- you can add line in code $.support.cors = true;
or
3.you can add jquery migrate js file resolve this. http://code.jquery.com/jquery-migrate-1.2.1.js
Comments
Post a Comment