return values from sql query when ajaxform is applied
I got a
$.ajax({
type: "get",
url: "detail.php",
data: "iq="+q,
success: function() {
$('#Title').text('value','');
}
and a sql query select statement. I want to return the value from the sql statement to #Title on the php page.
Thank开发者_C百科s Jean
Use
success: function (data, textStatus, XMLHttpRequest){
$('#Title').text('value',data);
}
It should look like this (.text()
takes one argument):
$.ajax({
type: "get",
url: "detail.php",
data: { iq: q },
success: function(data) {
$('#Title').text(data);
}
});
精彩评论