帮我看看这段代码,关于判断http:// window.open()的
<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript">
function openWindow(){
var boolean1 = confirm("是否打开新网站");
if (boolean1==true) {
var string1 = prompt("请您输入要打开的网站","http://www.imooc.com");
var string2 = "http://";
var string3 = string1.contains(string2);
if (string3==true) {
window.open(string1);
}else{
window.open("http://"+string1);
}
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>