【问题标题】:Jquery not functioning in bootstrap templateJquery 在引导模板中不起作用
【发布时间】:2015-12-31 01:22:37
【问题描述】:

我为我的项目https://almsaeedstudio.com/ 使用了引导模板。 我还添加了一些 jquery 脚本,但它不起作用。

我曾尝试使用此方法,但也无法正常工作。 i can't use javascript code with bootstrap template

这是我的html:

<button type="button" class="btn btn-primary btn-lg" id="view-more">Large</button>

这是我的 jquery 代码:

<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

<script>
var $j = jQuery.noConflict();
$j(document).ready(function(){
    $("#view-more").click(function(){
        alert("Test");
});
</script>

【问题讨论】:

  • 其中一个函数缺少右括号和括号! });

标签: javascript jquery bootstrap-modal


【解决方案1】:

你错过了结束});

var $j = jQuery.noConflict();
$j(document).ready(function(){
    $("#view-more").click(function(){
        alert("Test");
    });
});

【讨论】:

    猜你喜欢
    • 2014-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-07
    • 1970-01-01
    • 2019-05-25
    • 2015-09-19
    相关资源
    最近更新 更多