每次我尝试使用confirm()命令时,都会说没有定义确认。重要的是要注意我在Atom.io IDE中进行编程,并且我正在使用Script包来编译和运行我的程序。这是我试图运行的程序:
if ("atom".length >= 6)
{
console.log("The statement is true")
}
else
{
confirm("The statement is false")
}
答案 0 :(得分:0)
Atom的脚本包不会使用DOM或浏览器API运行JS,包括alert
和confirm
,甚至window
。您应该从浏览器运行脚本。
在这个StackSnippet中运行它,应该没问题:
if ("atom".length >= 6)
{
console.log("The statement is true")
}
else
{
confirm("The statement is false")
}
答案 1 :(得分:0)
Atom API提供t.AddOrUpdate("boo", (object)null, (k, v) => null);
,有关详细信息,请参阅documentation。
示例强>:
atom.confirm()