Batch deletion of JS code

Source: Internet
Author: User

  1. <script type="Text/javascript" >
  2. function Seltall () {
  3. var chckboxsign = document.getElementById ("ckb"); //ckb Select Box ID for all selected/reversed selection
  4. var chckbox = document.getelementsbyname ("Chckbox"); //All selection boxes It's all chckbox.
  5. var num = chckbox.length;
  6. if (chckboxsign.checked) {
  7. For (var index =0; index<num; index++) {
  8. chckbox[index].checked = true;
  9. }
  10. }else{
  11. For (var index =0; index<num; index++) {
  12. chckbox[index].checked = false;
  13. }
  14. }
  15. }
  16. function Deleseltedrecords () {
  17. var chckbox = document.getelementsbyname ("Chckbox");
  18. var num = chckbox.length;
  19. var ids = "";
  20. For (var index =0; index<num; index++) {
  21. if (chckbox[index].checked) {
  22. ids + = Chckbox[index].value + ",";
  23. }
  24. }
  25. if (ids!="") {
  26. if (window.confirm ("OK" to delete the selected record? ")){  
  27. $.ajax ({
  28. Type: "POST",
  29. URL: '.. /g3/history-no!batchdelete.action?ids= ' + IDs, //action to be deleted by itself
  30. DataType: ' json ',
  31. Success: function (data) {
  32. Alert ("Delete succeeded");
  33. Window.location.href = "Channel-no.action";
  34. },
  35. Error: function (data) {
  36. Alert ("System error, delete failed");
  37. }
  38. });
  39. }
  40. }else{
  41. Alert ("Please select a record to delete");
  42. }
  43. }
  44. </script>

Batch deletion of JS code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.