$.ajax is not working
Posted
by Geetha
on Stack Overflow
See other posts from Stack Overflow
or by Geetha
Published on 2010-05-25T04:50:35Z
Indexed on
2010/05/25
4:51 UTC
Read the original article
Hit count: 157
Hi All,
In my web page there is a textbox to get the scanned barcode value. Once we scan the barcode it has to get details from the database. I am creating the change event for the textbox.
Problem: $.ajax is not working.
Code:
var target = $('#txtBarcode'), val = target.val();
target.change(monitor());
function monitor() {
var xx = $('#txtBarcode').val();
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
data: "{}",
url: "HomePage.aspx/SearchProduct",
dataType: "json",
success: function(data) {
alert("Success!!!");
}
});
}
© Stack Overflow or respective owner