DennisSkov

Untitled

Jan 12th, 2021
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. <?php
  2. public function delete($vars)
  3. {
  4. $type=$_POST['type'];
  5. $status = array("status" => "success");
  6. echo json_encode($status);
  7. }
  8. ?>
  9.  
  10. //Script from HTML
  11. <script>
  12. function initiate_delete() {
  13. $.ajax({
  14. url: '{$modulelink}&action=delete',
  15. type: "post", //request type,
  16. dataType: 'json',
  17. data: { type: 'test' }
  18. }).done(function (data) {
  19. console.log(data.status);
  20. });
  21. }
  22. </script>
Advertisement
Add Comment
Please, Sign In to add comment