javascript - ajax doesnt pass variable to php script -
hi cant script work update script works fine doesnt seem pass variables update qty page
<script type='text/javascript'> function updateqty() { var str = $(this).attr('name'); var ordercode = str.slice(9, -1); var quantity = $(this).value; var xmlhttp = new xmlhttprequest(); xmlhttp.onreadystatechange = function() { xmlhttp.open("get","updateqty.php?id=" + ordercode + "&qty=" + quantity, true); xmlhttp.send(); } } </script> <input type='text' name='quantity[701]' size='3' tabindex='1' onblur='updateqty(this)' />
you might want define xmlhttp. they're not reusable, after all.
var xmlhttp = new xmlhttprequest();
this not cross-browser compliant fail on old ie. you're using jquery name selection - why don't make use of jquery.ajax
?
Comments
Post a Comment