Home >Web Front-end >JS Tutorial >Window.Open opens the form and if nested code_javascript skills

Window.Open opens the form and if nested code_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:05:191466browse

No more nonsense, let’s just post the code.

The specific code is as follows:

<script>
function openWindow(){
var my=confirm("你要打开窗口吗?")
if(my==true){
var url=prompt("通过输入对话框,确定打开的网址","http://www.imooc.com")
if(url!=null){
window.open('htttp://www.refw.org.cn','_blank','width=300,height=300,scrollbars=no,menubar=no')}
else{
alert('不打开');
} /*if嵌套*/
}
else{
alert("88")
}
}
</script> 
<body>
<input type="button" onclick="openWindow()" value="点击">
</body>

The code is just a few sentences. If you have any questions, please leave me a message. The editor will reply to you in time!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn