JavaScript Ajaxã??å??æ©

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JavaScript Ajaxã??å??æ©相关的知识,希望对你有一定的参考价值。

<html>
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8">
		<title>Ajax Test</title>

		<script type="text/javascript" charset="utf-8">
		function sendData() {
			request = new XMLHttpRequest();
			request.onreadystatechange=handleRespons;
			request.open("GET", "sender.php", true);
			request.send(null);
		}

		function handleRespons() {
			if (request.readyState == 4) {
				if (request.status == 200) {
					var fld = document.getElementById("response");
					fld.innerHTML = request.responseText
				}
			}
		}
		</script>
	</head>

	<form action="javascript:void%200" onsubmit="sendData();return false;">
		<button type="submit">現在時刻(サーバーの)</button>
	</form>

	<div id="response" style="color: red; font-size: 40px;" ></div>
</html>

以上是关于JavaScript Ajaxã??å??æ©的主要内容,如果未能解决你的问题,请参考以下文章

[JavaScript 刷题] 栈 - 基础计算器 II, leetcode 227

[JavaScript 刷题] 栈 - 基础计算器 II, leetcode 227

javascript PegarPosiçãodeum array

javascript Criandoapituraçãoparautilizar o knex

javascript Criaçãode输入类型没有graphql

javascript Helpers paravalidaçãodeformulários