main.js 437 B

123456789101112131415161718192021
  1. function save_settings(){
  2. var data = {};
  3. $('#setting_table tr').each(function(i,tr){
  4. if(i!=0){
  5. tr = $(tr);
  6. var key = tr.find('td').eq(0).text();
  7. if(key!=null && key!='' && key!='undefinded')
  8. data[key] = tr.find('td:eq(1) input').val();
  9. }
  10. });
  11. $.ajax({
  12. method: 'POST',
  13. url : 'action.php',
  14. data : {action:'SAVE_SETTINGS',data:data},
  15. success: function(response){
  16. alert(response);
  17. }
  18. });
  19. }