Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <html>
- <head>
- <meta charset="UTF-8">
- <title>
- Javascript Review
- </title>
- <script
- src="http://code.jquery.com/jquery-3.2.1.min.js"
- integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
- crossorigin="anonymous">
- </script>
- </head>
- <body>
- <input type="text" id="textInput"/>
- <!-- <button type="button" id="btnElement">
- Show me
- </button>-->
- <div id="content">
- </div>
- </body>
- <script type="text/javascript">
- document.getElementById("textInput").onkeyup = function () {
- $.ajax({
- "method": "POST",
- "url": "ajaxReceiver.php",
- "dataType": "JSON",
- "data":
- {
- "textValue": $("#textInput").val()
- },
- success: function (res) {
- $("#content").html(res.revString);
- }
- })
- }
- // var textInput = document.getElementById("textInput");
- // textInput.onkeyup = function () {
- // alert("Simpleng alert");
- // }
- //
- // var divContent = document.getElementById("content");
- // textInput.onkeyup = function () {
- // divContent.innerHTML = textInput.value;
- // }
- //
- // var jTextInput = $("#content");
- // jTextInput.keyup(function () {
- // $("#content").html("");
- // $("#textInput").val();
- // });
- //
- // document.getElementById("btnElement").onclick = function () {
- // var divContent = document.getElementById("content");
- // divContent.innerHTML = "<h1>Welcome to WebApp2</h1>";
- // }
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement