【发布时间】:2014-09-08 02:46:52
【问题描述】:
modal.modal('show');在所有其他浏览器中工作时在 Internet Explorer 中触发错误 错误是对象不支持属性或方法“模态”
注意:此模式由多个按钮调用,并且每次都需要更新,这就是我进行模式重置的原因。
顺便说一句,为什么我必须克隆模态两次才能进行模态重置?有没有更好的重置方法?
var original_model = "";
$(document).ready(function() {
original_model = $('#my_modal_id').clone();
})
function show_modal(user_photo) {
//reseting the modal
$("#my_modal_id").remove();
var myClone = original_model.clone();
$("body").append(myClone);
var modal = $("#my_modal_id");
modal.find("#photo").attr("src", user_photo);
// more code to update the modal ...
// Does not work in IE11 : Error : Object doesn't support property or method 'modal'
modal.modal('show');
}
【问题讨论】:
-
你能创建一个 jsfiddle 吗?
-
jsfiddle.net/79ov9agq/5 奇怪,它似乎在 jsfiddle 上工作,但它不会在我的现场网站上,我在我的网站上使用 BS 3.0 版,不确定它与它有什么关系
-
检查你的 jQuery 版本
-
您可能还想尝试将其从
modal重命名为其他名称。 -
尝试将剩余形式模态转换为 modal_ref 但没有运气
标签: javascript jquery twitter-bootstrap internet-explorer modal-dialog