jQuery serialize with Ajax does not work in IE9

断了今生、忘了曾经 提交于 2019-12-13 02:48:33

问题


function myTimestamp(){  
    tstmp = new Date();      
    return tstmp.getTime(); 
}   
function showValues() {  
    var str = ($("#this").serialize());  
    $("#results").text(str);  
}  
$(":checkbox, :radio").click(showValues);  
$("select").change(showValues);  
showValues();  
function sendValues() {  
    var str = $("#this").serialize();  
    var response = $('input[name=product[]]:checked').val();  
    $.ajax({  
        url: "/post.php?avoidcache=' + myTimestamp();",  
        data: {str}  
        cache: false  
    });  
}

This script works wonderful in Google Chrome; however when using in IE it only will execute one of the selected elements: the rest of the selected elements get cut off. Any suggestions?


回答1:


<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />


来源:https://stackoverflow.com/questions/5320193/jquery-serialize-with-ajax-does-not-work-in-ie9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!