Replace current page with ajax content

前端 未结 9 1266
南旧
南旧 2020-12-05 04:50

I have a page with a dialog window which sends ajax post data to server and receives a response. During development, there can be two responses - one regular (this is not th

9条回答
  •  情歌与酒
    2020-12-05 05:16

    I may be misunderstanding, but do you know what elements from the result you specifically want to display? You could trying something like this:

      success: function(data){
                   //store the response
                   var $response=$(data);
                   //use .find() to locate the div or whatever else you need
                   var errorMessage = $response.find('#warning').text();
                   alert(errorMessage);      
                }
    

    Is that what you were looking for?

提交回复
热议问题