jquery ajax从http url获取Responsetext

无论是:

var response = $.ajax({
    type: "GET",   
    url: "http://www.google.de",   
    async: false,
    success : function() {
        alert (this);
    }
});

也不:

var response2 = $.get("http://www.google.de", function(data) {
    alert("Data Loaded: " + data);
});

给我一个对象如何访问responseText?

你只需要这样重写:

var response = '';
$.ajax({ type: "GET",   
         url: "http://www.google.de",   
         async: false,
         success : function(text)
         {
             response = text;
         }
});

alert(response);
http://stackoverflow.com/questions/1152692/jquery-ajax-get-responsetext-from-http-url

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:jquery ajax从http url获取Responsetext