これは、3 つのブラウザすべてで問題なくフォームを送信できる唯一の方法です。これがそうである明確な理由はありますか?これに対するよりエレガントなソリューションは?jQuery 1.9 を使用しています。else のコードは IE と Firefox を介して送信するのに十分であるため、Chrome はここでは変わり者です。
function submitFormByPost(actionName){
$("#eventAction").val(actionName);
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
if(is_chrome){
document.getElementById('myForm').method='POST';
document.getElementById('myForm').submit();
}
else{
document.forms[0].method='POST';
document.forms[0].submit();
}
}