how do I get the reponse text from ajax / jquery?

后端 未结 3 670
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-02 04:45

Imagine I run this:

     $.ajax({
        type: \'POST\',
        url: \'/ajax/watch.php\',
        data: {\'watch\':\'aukcia\', \'id\':aukciaID},
        co         


        
3条回答
  •  囚心锁ツ
    2021-01-02 05:38

    I think you are receiving this in your server respones

    {message:'hello world'}
    

    if thats the case then use

    JSON.parse(data.responseText).message
    

    to convert the json string into javascript object and access your message property.

提交回复
热议问题