sub.js 595 B

1234567891011121314151617181920212223
  1. layui.use(['layer', 'form'], function(){
  2. var $ = layui.$;
  3. var form = layui.form;
  4. form.on('submit(*)', function(data) {
  5. var index = layer.load(1, {
  6. shade: [0.1,'#fff'] //0.1透明度的白色背景
  7. });
  8. var url = config.host + 'home.pub';
  9. $.ajax({
  10. url: url,
  11. type: 'get',
  12. dataType: 'jsonp',
  13. data: data.field,
  14. success: function (response) {
  15. layer.close(index);
  16. layer.alert('发送成功:' + response.data);
  17. }
  18. });
  19. return false;
  20. });
  21. });