问题
This displays 1 no matter what I echo in getbillno.php - also why I'm not showing that part anymore. Nothing would change unless I change bill into a string or put tbl (just to see what happens) in its place, so I figured the problem is not in getbillno.php but with this part right here. I'm very much new to jQuery and I really can't see what's wrong with this.
This works perfectly with Chrome, FF, and in Safari. I have other functions with jQuery in the same page and those work fine in any browser including IE(9). It's just with this one that I'm having problems.
<script type="text/javascript">
function getbillno(tbl){
$.get("getbillno.php?tbl="+ tbl, function(bill){
$("#billno").val(bill); });
}
</script>
I'm trying to make this work with IE(9) because it's the only browser that lets me have the Print options I want.
回答1:
Instead of hitting refresh, I tried closing IE(9) and it did display the right value. I changed the value in my code again then refreshed IE, it would display the one before that - it's the value after I reopened IE.
One line SOLVED my problems:
See it here: IE must close for event with jQuery to work
来源:https://stackoverflow.com/questions/7633511/get-not-working-in-ie