Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- public function delete($vars)
- {
- $type=$_POST['type'];
- $status = array("status" => "success");
- echo json_encode($status);
- }
- ?>
- //Script from HTML
- <script>
- function initiate_delete() {
- $.ajax({
- url: '{$modulelink}&action=delete',
- type: "post", //request type,
- dataType: 'json',
- data: { type: 'test' }
- }).done(function (data) {
- console.log(data.status);
- });
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment