Ajax

English [ˈeɪˌdʒæks] American [ˈeˌdʒæks]

n. The full name is "Asynchronous JavaScript and XML" (asynchronous JavaScript and XML); refers to a A web development technology for creating interactive web applications. ;Ajax copper-tin-lead bearing alloy, Ajax explosive

get

UK[get]  美[ɡɛt]  

vt.get ; catch; persuade; receive (punishment, etc.)

vt.& vi. arrive, come

vi.become; start; try to deal with; obtain benefits or wealth

n.Reproduction, cub; profit

ajax get() method syntax

Function: get() method loads information through remote HTTP GET request. This is a simple GET request function to replace the complex $.ajax. The callback function can be called when the request is successful. If you need to execute a function on error, use $.ajax.

Syntax: $(selector).get(url,data,success(response,status,xhr),dataType)

Parameters:

##url Required. Specifies the URL to which the request will be sent. data Optional. Specifies the data to be sent to the server with the request. success(response,status,xhr)Optional. Specifies a function to run when the request succeeds. Additional parameters: response - Contains the result data from the request status - Contains the status of the request xhr - Contains the XMLHttpRequest object. dataType Optional. Specifies the data type of expected server response. By default, jQuery will figure it out intelligently. Possible types: "xml" "html" "text" "script" "json" "jsonp"
ParametersDescription

Description: This function is abbreviated Ajax function, equivalent to: $.ajax({ url: url, data: data, success: success, dataType: dataType}); Depending on the different MIME types of the response, the return data passed to the success callback function is also different. The data can be XML root elements, text strings, JavaScript files, or JSON objects. You can also pass the textual status of the response to the success callback function.

ajax get() method example

<!DOCTYPE html>
<html>
<head>
<script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("button").click(function(){
       $.get("获取数据的文件地址",function(data,status){
	  	alert("数据:" + data + "\n状态:" + status);
	  });
  });
});
</script>
</head>
<body>

<button>向页面发送 HTTP GET 请求,然后获得返回的结果</button>

</body>
</html>