这里需要一点帮助。IE 9 - 对象不支持属性或方法'格式'
我决定在一个.js文件中传输我的一些javascript函数。这些功能在其他浏览器中正常工作除了IE浏览器。
注:下面 代码是存储在单独的js文件 “my_js.js”
var dialogConfirmed = false;
function DialogConfirmation(obj, title, dialogText) {
if (!dialogConfirmed) {
$('body').append("<div id='dialog' title='" + title + "'>'" + dialogText + "'</div>");
$('#dialog').dialog
({
height: 150,
modal: true,
resizable: false,
draggable: false,
close: function(event, ui) { $('body').find('#dialog').remove(); },
buttons:
{
'Yes': function() {
$(this).dialog('close');
dialogConfirmed = true;
if (obj) obj.click();
},
'No': function() {
$(this).dialog('close');
}
}
});
}
return dialogConfirmed;
}
使用
<asp:Button ID="btnAlert" runat="server" Text="Alert" OnClientClick="return DialogConfirmation(this, 'Popup Header', 'Popup Body Message');" onclick="btnAlert_Click" />
当点击它抛出的按钮和错误指向方法“格式”
**Microsoft JScript runtime error: Object doesn't support property or method 'Format'**
但是检查我的代码不使用'格式'。有关错误的任何想法?我在我的工作站上使用EI 9。
它究竟在哪里抛出错误?你有没有设置一个断点并通过? – 2013-02-18 08:26:16
你有两个'onclicks'。 – Jai 2013-02-18 08:29:53
此处发生错误。 ** $('body')。append(“