var webMethod = "http://localhost:54473/Service1.asmx/HelloWorld"; jQuery.support.cors = true; //之前没有加这句老是提示no transport,我没去深想。 $.ajax ({ type: "POST", contentType: "application/x-www-form-urlencoded", dataType: "html", url: "http://www.*****.com", //这里是网址 success:function(data){alert(data);}, timeout:30000, error: function (XMLHttpRequest, textStatus, errorThrown) { alert(errorThrown); } });
http://www.cnblogs.com/william-lin/archive/2012/08/22/2650880.html