<!DOCTYPE html>
<html>
<head>
<title>Second</title>
<script type="text/javascript" src = "https://code.jquery.com/jquery-3.3.1.js"></script>
<script type="text/javascript">
var xhr;
function createXmalHRequest(){
if(window.ActiveXObject){
return new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest){
return new XMLHttpRequest;
}
}
function handleStateChange(){
if(xhr.readyState == 4){
if(xhr.status == 200){
alert("the change is"+xhr.responseText);
$(document).ready(function(){
$("p.a").html(xhr.responseText);
})
}
}
}
function startAjax(){
xhr = createXmalHRequest();
xhr.open("GET","gagaga.txt",true);
xhr.onreadystatechange = handleStateChange;
xhr.send(null);
}
$(function(){
JQUERY Click()方法调用 外部函数
最新推荐文章于 2024-02-23 15:48:25 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)