1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
<html>
<%@page contentType="text/html; charset=utf-8" %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<head>
<script type="text/javascript">
function ajaxCall()
{
var request = new XMLHttpRequest();
request.onreadystatechange = function()
{
if (request.readyState == 4)
{
document.getElementById("content").innerHTML = request.responseText;
}
};
request.open("POST", "/Web1/Servlet2", true);
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
request.send("param=êtes-vous content");
}
setTimeout("ajaxCall()", 2000);
</script>
</head>
<body>
Exemple d'appel AJAX
<div id="content">...</div>
</body>
</html> |
Partager