Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset=utf-8" />
- <title>Ajax Test</title>
- </head>
- <body>
- <div id="response">AJAX</div>
- <input type="button" value="Load Ajax" onclick="runAjax()" />
- <script>
- function runAjax(){
- var xmlhttp = new XMLHttpRequest
- xmlhttp.onreadystatechange = function(){
- if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
- document.getElementById("response").innerHTML = xmlhttp.responseText;
- }
- };
- xmlhttp.open("GET", "odpowiedz.txt", true);
- xmlhttp.send();
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement