我有一个总变量,我使用从PHP/JS的下拉框中更改的刷新获取请求进行更新。似乎在Firefox中正常工作,但在Chrome/IE中完全没有问题。有什么建议么?Javascript onchange()不适用于Chrome和IE
<form action='cart.php' onchange = 'go()'>
<select id = 'postinfo' name = 'postage'>
<script>
function go() {
var x = document.getElementById("postinfo").value;
if (x == "express") {
var price = 9.99
window.location.href = "cart.php?delivery=" + price + "&item=express";
}else if (x == "free"){
var price = 4.99
window.location.href = "cart.php?delivery=" + price + "&item=free";
}
}
</script>
东西在你的代码是不正确的。请修复它。为什么你有围绕HTML的报价? – gdoron