无论是:
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",success : function(text) { response = text; } }); alert(response);