jquery ajax parse response text

前端 未结 5 1692
执念已碎
执念已碎 2020-12-03 12:19

Ok this is really frusturating me because I\'ve done this a hundred times before, and this time it isn\'t working. So I know I\'m doing something wrong, I just can\'t figur

5条回答
  •  臣服心动
    2020-12-03 12:32

    I know this is an old post but I've been having the EXACT same frustrating problem for a couple of hours and have found a solution. For me what actually worked was to have the html content wrapped with a form tag.

    So having the following html source:

    
     
      
       
    Some Stuff

    With this jquery snippet should work:

    var callback = function (data) {
       alert($("#content", $(data)).html());
    };
    $.get(url, null, callback, null);
    

    Hope this helps...

提交回复
热议问题