开发者

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);
  }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜