标签:comment display abi res jquer color 赋值 osi 选择
toggle() 方法切换元素的可见状态。
如果被选元素可见,则隐藏这些元素,如果被选元素隐藏,则显示这些元素。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<input type="button" id="but1" value="点击获取服务器的值" onclick="a()">
<input type="text" id="aaa">
<script src="../js/jquery-1.11.0.js"></script>
<script>
function a() {
$("#but1").load("/ServletTest",function (responseText) {
$("#aaa").val(responseText);
})
}
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<input type="button" id="but1" value="点击获取服务器的值" onclick="a()">
<input type="text" id="aaa">
<script src="../js/jquery-1.11.0.js"></script>
<script>
function a() {
$("#but1").load("/ServletTest",function (responseText) {
?
$("#aaa").val(responseText);
})
}
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div id="div1"></div>
<script src="../js/jquery-1.11.0.js"></script>
<script>
$.get("/ServletTest?username=mljqqhq",function (data,status) {
$("#div1").html(data+status);//data是服务器响应的数据
})
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div id="div1"></div>
<script src="../js/jquery-1.11.0.js"></script>
<script>
$.get("/ServletTest?username=mljqqhq",function (data,status) {
$("#div1").html(data+status);//data是服务器响应的数据
})
</script>
?
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div id="div1"></div>
<script src="../js/jquery-1.11.0.js"></script>
<script>
$.post("/ServletTest",{"username":"mljqqhpost"},function (data,status) {
$("#div1").html(data+status);//data是服务器响应的数据
})
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div id="div1"></div>
<script src="../js/jquery-1.11.0.js"></script>
<script>
$.post("/ServletTest",{"username":"mljqqhpost"},function (data,status) {
$("#div1").html(data+status);//data是服务器响应的数据
})
</script>
?
</body>
</html>
$.ajax({
url:"/ajaxDemo",
data:{"name":"哈哈哈","age":4},
async:true,
type:"GET",
dataType:"text",
success:function (succRes) {
alert(succRes);
},
error:function (errorRes) {
alert("出现异常了")
}
});
x
$.ajax({
url:"/ajaxDemo",
data:{"name":"哈哈哈","age":4},
async:true,
type:"GET",
dataType:"text",
success:function (succRes) {
alert(succRes);
},
error:function (errorRes) {
alert("出现异常了")
}
});
标签:comment display abi res jquer color 赋值 osi 选择
原文地址:https://www.cnblogs.com/mljqqh/p/10493735.html