此代码在 IE 中不起作用,为什么不呢?
$('body').append('<div id="iedialog"><h2 class="dialog-header">Alert!</h2><div class="dialog-container"><center>It looks like you are using Internet Explorer! Please switch to another browser to use all our Designer features. We recommend Firefox (<a href="www.firefox.com">www.firefox.com</a>) and Google Chrome (<a href="www.google.com/chrome">www.google.com/chrome</a>) for an overall better internet experience.<br /><br /><input type="button" value="OK" id="okiedialog"></center>');
然而,如果我将这个确切的代码复制并粘贴到控制台中,它就可以工作。