Bootstrap页面中多个modal报”too much recursion”错误的解决方案

在用Bootstrap时候发现,如果我在一个弹出的modal中再弹出一个modal的时候,js就会报错“too much recursion”,从而会影响modal中弹出的那个modal里面的一些jquery插件的使用,解决方案就是把$.fn.modal.Constructor.prototype.enforceFocus 方法去掉就可以了。

在Bootstap.js 包含以后加上:

$.fn.modal.Constructor.prototype.enforceFocus = function () {};


这样就不会报错了!

猜你喜欢

转载自blog.csdn.net/u011025329/article/details/52815517
今日推荐