打开新网页之后,为什么是把输入的网址连接到了之前的一个网址上,如何解决这个问题?就像是默认的网址是http://www.imooc.com/,然后用open打开的时候网址却变成了http://www.imooc.com/code/http%EF%BC%9A//www.imooc.com/
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
function openwindow(){
var opennew=confirm("是否打开?");
if(opennew==true)
{
var mystr=prompt("是否打开?"," http://www.imooc.com/");
window.open(mystr,' http://www.imooc.com/','width=400,height=500');
}
}
</script>
<form>
<input type="button" value="js新窗口打开网页" onclick="openwindow()">
</form>
</body>
</html>
哪里不对?
function openWindow()
{
var opennew=prompt("是否打开新的窗口?","http://www.imooc.com/");
if(opennew!=null)
{
window.open(opennew,'_blank','width=400,height=500,menubar=no,toolvar=no');
}
}