Home  >  Article  >  Web Front-end  >  jQuery中通过ajax的get()函数读取页面的方法_jquery

jQuery中通过ajax的get()函数读取页面的方法_jquery

WBOY
WBOYOriginal
2016-05-16 15:12:571156browse

首先介绍get()函数:

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


参数说明:
url:待载入页面的URL地址
data:待发送 Key/value 参数。
callback:载入成功时回调函数。
type:返回内容格式,xml, html, script, json, text, _default。
首先建立testGet.php实例:

<?php
$web = $_GET['webname'];
echo "你现在访问的网站是:".$web;
?>

然见建立ajax.html文件:




php点点通 - 关注php开发,提供专业web开发教程! 



显示的内容如下:

测试前的初始页面是:

点击测试后的结果是:

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