<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/mootools/1.2.2/mootools-yui-compressed.js"></script>
<script type="text/javascript" src="sexyalertbox.v1.2.moo.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="sexyalertbox.css"/>
<body>
<p><a href="#" onclick="Sexy.alert('<h1>hello</h1><p>Please enter a valid email address</p>');return false;">Click here</a></p>
</body>
</html>当我们点击点击这里,一个警告框就会出现。我希望在javascript ie中有那个警告框。
alert("Same sexy alert box type alert box"); // hwo to do this??发布于 2010-05-17 17:26:29
只需在脚本后面添加以下内容:
Window.prototype.alert = function(message){
Sexy.alert(message);
};顺便说一句。从不在你的中使用onclicks。在JS文件中使用事件处理程序。
下面是一个有效的测试用例:http://jsfiddle.net/bRjcG/3/
https://stackoverflow.com/questions/2847233
复制相似问题