Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="it">
- <head>
- <meta charset="utf-8">
- </head>
- <body>
- <form method="post" action="comments.php">
- <p><input type="text" name="name"></p>
- <p><textarea rows="10" cols="50" name="message"></textarea></p>
- <p><input type="submit" name="save" value="save"></p>
- </form>
- <p>Comments</p>
- <div id="comments"></div>
- <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
- <script>
- $.ajax({
- type: "post",
- url: "comments.html",
- dataType: 'html',
- contentType: "text/html; charset=utf-8;",
- success: function(response) {
- $("#comments").html(response);
- },
- error: function(e){
- console.log(e.responseText);
- }
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement