Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // your ajax.php
- if (isset($_POST['checkLikes'])) {
- exit('hello world');
- }
- // your test.php
- <div id="response"></div>
- <script
- src="https://code.jquery.com/jquery-3.3.1.min.js"
- integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
- crossorigin="anonymous"></script>
- <script>
- setInterval(function(){
- $.ajax({
- type: "POST",
- url: "ajax.php",
- data: {'checkLikes' : 'test'},
- success: function (response) {
- $('#response').html(response);
- console.log(response);
- }
- })
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement