function openWindow(){
var sure=confirm("確認打開?");
if (sure==true)
{var new= prompt("輸入網址鏈接","wwww.hupu.com");
if(new!=null)
window.open('http://www.hupu.com/', '_blank','width=400,height=500,menubar=no,toolbar=no');
}
else {
return false;
}
}
var sure=confirm("確認打開?");
if (sure==true)
{var new= prompt("輸入網址鏈接","wwww.hupu.com");
if(new!=null)
window.open('http://www.hupu.com/', '_blank','width=400,height=500,menubar=no,toolbar=no');
}
else {
return false;
}
}
BUG?。?!
在chrome瀏覽器添加這行代碼mywin.close();時一直打開新窗口,
于是
只能先把var mywin=window.open("http://www.xianlaiwan.cn");注釋掉!
在chrome瀏覽器添加這行代碼mywin.close();時一直打開新窗口,
于是
只能先把var mywin=window.open("http://www.xianlaiwan.cn");注釋掉!
2015-08-12
錯誤寫法:window.open('http://imooc.com','_blank','width=600','height=400','top=100','left=0');
正確寫法:window.open('http://imooc.com','_blank','width=600,height=400,top=100,left=0')
正確寫法:window.open('http://imooc.com','_blank','width=600,height=400,top=100,left=0')
2015-08-12
注意 這個地方的 className ,還有前面提到過的getElementById等等都必須嚴格遵循駝峰法 否則將不起作用
2015-08-11
表示沒事干喜歡亂改文本。。。
function contxt() //定義函數
{
alert("我靠,讓你點還真點啊,還好我不是釣魚鏈接,不然兄弟你就慘了!");
}
</script>
</head>
<body>
<form>
<input type="button" value="你敢點點我嗎?" onclick="contxt()" />
</form>
function contxt() //定義函數
{
alert("我靠,讓你點還真點啊,還好我不是釣魚鏈接,不然兄弟你就慘了!");
}
</script>
</head>
<body>
<form>
<input type="button" value="你敢點點我嗎?" onclick="contxt()" />
</form>
2015-08-11
object.style.color,font,backgroundColor,font,fontFamily,fontSize,width,height
2015-08-11
alert():
彈出對話框
confirm():
確認返回true,取消返回false
prompt("",""):
返回字符串值
window.open("url","_blank/_self/_top","width=300,top,height,left,menubar,scrollbar,toolbar,status");
彈出對話框
confirm():
確認返回true,取消返回false
prompt("",""):
返回字符串值
window.open("url","_blank/_self/_top","width=300,top,height,left,menubar,scrollbar,toolbar,status");
2015-08-11
function openWindow()
{
var mywin=prompt('請輸入你想進入的網址');
if(mywin=="http://www.xianlaiwan.cn")
{
window.open('http://www.xianlaiwan.cn','_blank','width=400,height=500,menubar=no,toolbar=no');
}
else{if(mywin==''){alert("網址不能為空");}else{alert("請輸入正確的網址");}}}
{
var mywin=prompt('請輸入你想進入的網址');
if(mywin=="http://www.xianlaiwan.cn")
{
window.open('http://www.xianlaiwan.cn','_blank','width=400,height=500,menubar=no,toolbar=no');
}
else{if(mywin==''){alert("網址不能為空");}else{alert("請輸入正確的網址");}}}