Delete Script Ajax


SUBMITTED BY: manikandanvg

DATE: May 2, 2016, 11:53 p.m.

FORMAT: JavaScript

SIZE: 635 Bytes

HITS: 4067

  1. <script type="text/javascript">
  2. //delete script
  3. $(function() {
  4. $(".delete").click(function(){
  5. var element = $(this);
  6. var del_id = element.attr("id");
  7. var info = 'id=' + del_id;
  8. //var parent = $(this).parent();
  9. var parent = $(this).closest('tr');
  10. if(confirm("Are you sure you want to delete this?"))
  11. {
  12. $.ajax({
  13. type: "POST",
  14. url: "deleteexpid.php",
  15. data: info,
  16. success: function(){
  17. }
  18. });
  19. $(this).closest('tr').animate({ backgroundColor: "#00040" }, "slow").animate({ opacity: "hide" }, "slow");
  20. parent.slideUp(300,function() {
  21. parent.remove();});
  22. }
  23. return false;
  24. });
  25. });
  26. </script>

comments powered by Disqus