匿名函数window对象confirmprompt

Posted wfl9310

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了匿名函数window对象confirmprompt相关的知识,希望对你有一定的参考价值。

<script>
    (function(arg) {//匿名函数,没有名字
         alert(arg)
     })(hello,jerry)
</script>
<script>
    //bom对象,浏览器对象模型。使javascript有能力与浏览器‘对话’
    window.alert(‘hello‘)//window是一个全局变量
    var ret=window.confirm("你来了么")//弹出窗口多出了选择,有确定和取消,有返回值可以被接收
    console.log(ret)//可以获得true或者false
    var msg=window.prompt("请输入留言内容:")//有一个文本框
    console.log(msg)//可以获取输入的内容
</script>

 

以上是关于匿名函数window对象confirmprompt的主要内容,如果未能解决你的问题,请参考以下文章