【问题标题】:jquery script not working in bootstrap modal windowjquery脚本在引导模式窗口中不起作用
【发布时间】:2016-11-24 04:32:15
【问题描述】:

Jquery 功能代码在正常的 php 页面中运行,但在引导模式窗口中无法运行......请。帮我?? `

【问题讨论】:

    标签: jquery function bootstrap-modal


    【解决方案1】:
    (function($) {
      $(document).on("click", "#send-email", function(e) {
        alert('works');
        e.preventDefault();
      });
    });
    

    $(document).click() 而不是 $(document).on()。因为,on 将适用于新添加的内容。但是单击不会对新添加的内容起作用。

    参考:http://api.jquery.com/on/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-05
      • 1970-01-01
      • 2023-03-18
      • 2015-10-19
      • 1970-01-01
      相关资源
      最近更新 更多