【发布时间】:2016-05-26 17:10:32
【问题描述】:
window.alert = function (text) {
swal({
title: "Computer says:",
text: text,
timer: 3000,
animation: "slide-from-top"
});
return true;
};
function run(input) {
if (input[0] == "alert") {
ta = input.slice(1, input.length);
tap = ta.join(" ");
alert(tap);
}
}
当我拨打run(["alert", "hello"]); in the javascript console 时,它工作正常。
但是当我type in alert hello, in my console 时,对话框会短暂闪烁并消失。这里发生了什么,我该如何阻止它?谢谢!
【问题讨论】:
标签: javascript html css dialog sweetalert