var val = prompt("是否打開網址","www.jd.com");
if(val==""){ window.open('http://www.jd.com','_blank','width=600,height=600')
}else if(val=="www.jd.com"){window.open('http://www.jd.com','_blank','width=600,height=600')
}else{ window.open("http://"+val,'_blank','width=600,height=600)}
if(val==""){ window.open('http://www.jd.com','_blank','width=600,height=600')
}else if(val=="www.jd.com"){window.open('http://www.jd.com','_blank','width=600,height=600')
}else{ window.open("http://"+val,'_blank','width=600,height=600)}
<title>confirm</title>
<script type="text/javascript">
function rec(){
var mymessage=confirm("你他媽的有把沒把") ;
if(mymessage==true)
{
document.write("你他媽是個娘們!");
}
else
{
document.write("死癡漢還冠冕堂皇地選上了!");
}
}
</script>
<script type="text/javascript">
function rec(){
var mymessage=confirm("你他媽的有把沒把") ;
if(mymessage==true)
{
document.write("你他媽是個娘們!");
}
else
{
document.write("死癡漢還冠冕堂皇地選上了!");
}
}
</script>
2016-02-26
<script type="text/javascript">
var mychar=document.getElementById("con"); ;
document.write("原標題:"+mychar.innerHTML+"<br>"); //輸出原h2標簽內容
mychar.innerHTML = "Hello world!"
document.write("修改后的標題:"+mychar.innerHTML); //輸出修改后h2標簽內容
</script>
var mychar=document.getElementById("con"); ;
document.write("原標題:"+mychar.innerHTML+"<br>"); //輸出原h2標簽內容
mychar.innerHTML = "Hello world!"
document.write("修改后的標題:"+mychar.innerHTML); //輸出修改后h2標簽內容
</script>
2016-02-25
function hidetext(){
var mychar=document.getElementById("con");
mychar.style.display=none;}
function showtext(){
var mychar=document.getElementById("con")'
mychar.styel.display=block;
}
var mychar=document.getElementById("con");
mychar.style.display=none;}
function showtext(){
var mychar=document.getElementById("con")'
mychar.styel.display=block;
}
2016-02-25
<script type="text/javascript">
var mychar=document.getElementById("con")'
mychar.styel.color="red";
mychar.style.backgroundColor="#ccc";
mychar.sytle.width="300px";
<script>
var mychar=document.getElementById("con")'
mychar.styel.color="red";
mychar.style.backgroundColor="#ccc";
mychar.sytle.width="300px";
<script>
2016-02-25
function openWindow(){
var mymessage=confirm("是否打開?");
if(mymessage==true)
{var score;
score =prompt("是否確定打開網址:如確定請輸入是");
if(score=="是")
{window.open('http://www.xianlaiwan.cn/','_blank','width=400,height=500'); }
else{document.write("對不起輸入有誤!");}
}
else
{
document.write("已關閉!");
}
}
var mymessage=confirm("是否打開?");
if(mymessage==true)
{var score;
score =prompt("是否確定打開網址:如確定請輸入是");
if(score=="是")
{window.open('http://www.xianlaiwan.cn/','_blank','width=400,height=500'); }
else{document.write("對不起輸入有誤!");}
}
else
{
document.write("已關閉!");
}
}
僅作參考!
function openWindow(){
var r=confirm("是否打開新網頁?");
if(r==true)
{
var t=prompt("請輸入網址:",'http://www.xianlaiwan.cn/');
if(t!=null)
{
window.open(t+'','_blank','width=400,height=500,menubar=no,toolbar=no')
}
}
function openWindow(){
var r=confirm("是否打開新網頁?");
if(r==true)
{
var t=prompt("請輸入網址:",'http://www.xianlaiwan.cn/');
if(t!=null)
{
window.open(t+'','_blank','width=400,height=500,menubar=no,toolbar=no')
}
}
function openWindow(){
// 新窗口打開時彈出確認框,是否打開
var webname=prompt('是否打開?','www.xianlaiwan.cn');
// 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
if(webnam=true){
//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
window.open(webname,'_blank','width=400,height=500,menubar=no,toolbar=no')
}
// 新窗口打開時彈出確認框,是否打開
var webname=prompt('是否打開?','www.xianlaiwan.cn');
// 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
if(webnam=true){
//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
window.open(webname,'_blank','width=400,height=500,menubar=no,toolbar=no')
}