<script type="text/javascript">
function openWindow(){
var con=confirm("是否打開新窗口?");
if(con==true){
var pro=prompt("是否要打開該網頁?","http://www.xianlaiwan.cn/");
window.open('http://www.xianlaiwan.cn/','_top','width=400,height=500');
}else{
alert("請點擊確認鍵");
}
}
</script>
function openWindow(){
var con=confirm("是否打開新窗口?");
if(con==true){
var pro=prompt("是否要打開該網頁?","http://www.xianlaiwan.cn/");
window.open('http://www.xianlaiwan.cn/','_top','width=400,height=500');
}else{
alert("請點擊確認鍵");
}
}
</script>
var mychar=document.getElementById("con");;
document.write("原標題:"+mychar.innerHTML+"<br>");
//mychar.innerHTML=prompt("請輸入你要變更的內容:","Hello World!")
document.write("修改后的標題:"+mychar.innerHTML);
用prompt更會好的實現交互。
document.write("原標題:"+mychar.innerHTML+"<br>");
//mychar.innerHTML=prompt("請輸入你要變更的內容:","Hello World!")
document.write("修改后的標題:"+mychar.innerHTML);
用prompt更會好的實現交互。
2016-04-14
“document.write can be a form of eval.”:“document.write是eval的一種形式”, eval要盡量避免,是出于安全考慮,因為eval過于強大,他可以把string串作為代碼執行。如果控制不好就會造成安全漏洞。
2016-04-14
object.removeAttribute('style')移除當前設置的屬性,話說這個前面章節么有的,,看到評論才去找的資料
function openWindow(){
var dianji=confirm("是否打開窗口");
if(dianji==true){
var www=prompt("你要打開的網址是:","http://www.xianlaiwan.cn");
window.open(www,'_blank','width=400,height=500,menubar=no,toolbar=no');
}else{
}
}
var dianji=confirm("是否打開窗口");
if(dianji==true){
var www=prompt("你要打開的網址是:","http://www.xianlaiwan.cn");
window.open(www,'_blank','width=400,height=500,menubar=no,toolbar=no');
}else{
}
}
function openWindow() {
var cnf=confirm("是否在新窗口打開網頁?") ;
if (cnf==true){
alert ("將要打開http://www.xianlaiwan.cn/") ;
window.open ("http://www.xianlaiwan.cn/","_blank","width=400,height=500,menubar=no,toolbar=no");}
else {}
}
var cnf=confirm("是否在新窗口打開網頁?") ;
if (cnf==true){
alert ("將要打開http://www.xianlaiwan.cn/") ;
window.open ("http://www.xianlaiwan.cn/","_blank","width=400,height=500,menubar=no,toolbar=no");}
else {}
}
2016-04-13
function openWindow(){
var win=confirm('是否打開新窗口?')
if (win!=0)
{
var dow=prompt('請輸入你要打開的網址')
window.open('http://www.xianlaiwan.cn/','_blank','width:400px','height:500px','menuber=no','toolbar=no');
}
else
{
document.write("你已經取消打開窗口");
}
}
var win=confirm('是否打開新窗口?')
if (win!=0)
{
var dow=prompt('請輸入你要打開的網址')
window.open('http://www.xianlaiwan.cn/','_blank','width:400px','height:500px','menuber=no','toolbar=no');
}
else
{
document.write("你已經取消打開窗口");
}
}