大佬教程收集整理的这篇文章主要介绍了jQuery Bootstrap:“TypeError:’undefined’不是一个函数(评估’jQuery(‘#myModal’).modal(‘hide’)’),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
function(){ jQuery('#mymodal').modal('hide'); }
但模态视图不会被隐藏.我仔细检查了我在Bootstrap之前包含jQuery,所以问题不在那里.
我总是得到以下错误:
TypeError: 'undefined' is not a function (evaluaTing 'jQuery('#mymodal').modal('hide')')
模态看起来像这样:
<!-- Modal --> <div aria-hidden="false" aria-labelledby="modalInviteFlatmateLabel" role="dialog" tabindex="-1" class="modal hide fade in" id="mymodal"> <form id="add-flatmate-form" action="/flatmates/show" method="post"> <div class="modal-header"> <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button> <h3 id="modalInviteFlatmateLabel">Invite Flatmate</h3> </div> <div class="modal-body"> <p> Enter the mail address of your flatmate you want to invite. </p><br /> <input placeholder="E-Mail" class="input-block-level" name="AddFlatmateForm[email]" id="AddFlatmateForm_email" type="text" /> </div> <div class="modal-footer"> <input class="btn btn-priMary" type="submit" name="yt0" value="Invite" id="yt0" /> <!--<button class="btn btn-priMary">Invite</button>--> </div> </form> </div><!--#mymodal-->
附加信息:
> jQuery版本:1.9.1,
> Bootstrap版本:2.3.2
有任何想法吗?
(function ($) { $(document).ready(function(){ //your code ('# id of the modal element to close ').modal('hide') }); //your code }(jQuery));
您可以查看此视频link to tutorial,我认为他们已经很好地公开了调试过程.
以上是大佬教程为你收集整理的jQuery Bootstrap:“TypeError:’undefined’不是一个函数(评估’jQuery(‘#myModal’).modal(‘hide’)’)全部内容,希望文章能够帮你解决jQuery Bootstrap:“TypeError:’undefined’不是一个函数(评估’jQuery(‘#myModal’).modal(‘hide’)’)所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。