我有一个总变量,我使用PHP/JS下拉框中的更改时使用刷新获取请求更新.似乎在Firefox中运行良好,但与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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2430 次 |
| 最近记录: |