Javascript Document.ready在使用grunt服务器时不工作

Javascript Document.ready在使用grunt服务器时不工作,javascript,gruntjs,Javascript,Gruntjs,我在index.html中有这些脚本,用于测试grunt build web app,但我发现,它实际上没有在DOM就绪时运行该函数,如果以正常方式运行此index.html,它会工作,但在grunt中,它没有,是否有任何潜在的问题可能导致它 <script> $(document).ready(function() { $('.button_1').click(function() { $(".volt

我在index.html中有这些脚本,用于测试grunt build web app,但我发现,它实际上没有在DOM就绪时运行该函数,如果以正常方式运行此index.html,它会工作,但在grunt中,它没有,是否有任何潜在的问题可能导致它

    <script>
        $(document).ready(function() {
            $('.button_1').click(function() {
                $(".voltage").show();
                $(".current").hide();
                $(".button_2").hide();
                });
            $('.button_2').click(function() {
                $(".voltage").hide();
                $(".current").show();
            });
        });
    </script>

$(文档).ready(函数(){
$('.button_1')。单击(函数(){
$(“.voltage”).show();
$(“.current”).hide();
$(“.button_2”).hide();
});
$('.button_2')。单击(函数(){
$(“.voltage”).hide();
$(“.current”).show();
});
});

另外,在运行jquery.js之前,我已经加载了它。

有控制台错误吗?我想知道$namespace是否冲突。可以尝试
jQuery(函数($){})。在grunt中运行index.html是什么意思?