jquery $.post function's result data

前端 未结 4 1128
死守一世寂寞
死守一世寂寞 2021-01-16 09:18

When I make an ajax call (see code below), what is \"data\". How do I set and get data

//  $.post()  
 $(\"#post\").click(function(){  
     $(\"#result\").h         


        
4条回答
  •  野的像风
    2021-01-16 09:46

    The documentation for $.post says that data "could be xmlDoc, jsonObj, html, text, etc...". It's whatever the server returns for the loadUrl you specified with the given parameters (in your case, language: "php", version: 5), so you need to examine what the server is returning.

    Just alert(data) in your callback and you'll see what was returned.

    Update: renamed 'responseText to 'data', since the OP changed the question to do that.

提交回复
热议问题