Home >Web Front-end >JS Tutorial >Detailed explanation of the steps to read the page using jQuery+ajax using the get() function

Detailed explanation of the steps to read the page using jQuery+ajax using the get() function

php中世界最好的语言
php中世界最好的语言Original
2018-04-25 15:11:022328browse

This time I will bring you a detailed explanation of the steps to read the page using jQuery ajax's get() function. What are the precautions for using jQuery ajax's get() function to read the page? The following is a practical case, let’s take a look.

First introduce the get() function:

url,[data],[callback],[type]

Parameter description:

url: URL address of the page to be loaded
data: Key/value parameter to be sent.
callback:
Callback function when loading is successful. type: Return content format, xml, html, script, json, text, _default.

First create the testGet.php instance:

48c6a906d75292dbb1eb32154718c46c
Then create the ajax.html file:

100db36a723c770d327fc0aef2ce13b1
93f0f5c25f18dab9d176bd4f6de5d30e
a71ddd814d1e6bfc91cd420de31796d5
b2386ffb911b14667cb8f0f91ea547a7 PHP 6e916e0f7d1e588d4f442bf645aedb2f
c4e547c8d3e2939359339534ffc9f2af2cacc6d41bbb37262a98f745aa00fbf0
3f1c4e4b6b16bbbd69b2ee476dc4f83a
	$(document).ready(function(){
		$("#btn").click(function(){
			$.get("testGet.php",{web:"www.phpddt.com"},function(data,textStatus){
				$("#result").append("data:"+data);
				$("#result").append("0c6dc11e160d3b678d68754cc175188atextStatus:"+textStatus);
			});		
		});
	});
2cacc6d41bbb37262a98f745aa00fbf0
9c3bca370b5104690d9ef395f2c5f8d1
6c04bd5ca3fcae76e30b72ad730ca86d
6bb7346ab001b287e8a5b8175c11e705
c1a436a314ed609750bd7c7d319db4da显示的内容如下:2e9b454fa8428549ca2e64dfac4625cd
c1757100b96bd3b4b5f5016cda91308f94b3e26ee717c64999d7867364b1b4a3
36cc49f0c466276486e50c850b7e4956
73a6ac4ed44ffec12cee46588e518a5e
I believe you have mastered the method after reading the case in this article, and more How exciting, please pay attention to other related articles on php Chinese website!

Recommended reading:

Detailed explanation of the steps of ajax reading properties

Summary of jquery ajax form submission method

The above is the detailed content of Detailed explanation of the steps to read the page using jQuery+ajax using the get() function. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn