多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[TOC] ## 语法 ``` jQuery.get( url [, data ] [, success(data, textStatus, jqXHR) ] [, dataType ] ) 参数说明: dataType 从服务器返回的预期的数据类型。默认:智能猜测(xml, json, script, 或 html)。 ``` ### jqXHR 对象可使用 Promise ``` var jqxhr = $.get("example.php", function() { alert("success"); }) .success(function() { alert("second success"); }) .error(function() { alert("error"); }) .complete(function() { alert("complete"); }); // code // Set another completion function for the request above jqxhr.complete(function(){ alert("second complete"); }); ``` ## 示例 ### hello world ``` var data={ tags: "mount rainier", tagmode: "any", format: "json" }, $.get('ajax/test.html',data, function(data) { $('.result').html(data); alert('Load was performed.'); }); ```