Home > Web Front-end > JS Tutorial > body text

Window.Open opens the form and if nested code_javascript skills

WBOY
Release: 2016-05-16 15:05:19
Original
1385 people have browsed it

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!