open()中的參數(shù) 有第二個,必須要有第一個,要有第三個,前兩個必須有而且還要在其之前,要不然就會有顯示問題。也就是說,參數(shù)值的位置是固定的,第一個參數(shù)就是地址,第二按參數(shù)就是窗口名稱,第三個就是窗口限制條件。
2020-05-15
<script type="text/javascript">
var mychar= document.getElementById("con");
mychar.style.color="red";
mychar.style.backgroundColor="#ccc";
mychar.style.width="300px";
</script>
var mychar= document.getElementById("con");
mychar.style.color="red";
mychar.style.backgroundColor="#ccc";
mychar.style.width="300px";
</script>
2020-05-07
function openWindow(){
var mymessage=confirm("是否打開新窗口?");
if(mymessage==true)
{
window.open('http://idcbgp.cn','_blank','width=400,height=500,menubar=no,toolbar=no');
}
else
{
alert("啥子!");
}
}
var mymessage=confirm("是否打開新窗口?");
if(mymessage==true)
{
window.open('http://idcbgp.cn','_blank','width=400,height=500,menubar=no,toolbar=no');
}
else
{
alert("啥子!");
}
}
2020-05-07
//定義"取消設(shè)置"的函數(shù)
function quxiao(){
var b=confirm("是否取消所有設(shè)置?");
if(b=true){
document.getElementById("txt").style="txt";
}
}
function quxiao(){
var b=confirm("是否取消所有設(shè)置?");
if(b=true){
document.getElementById("txt").style="txt";
}
}
2020-05-01
在這里跟新人說一下,
<script type="text/javascript">這句話其實沒有必要,因為script的默認(rèn)type就是javascript
<script type="text/javascript">這句話其實沒有必要,因為script的默認(rèn)type就是javascript
2020-04-24
原來要使用javascript,是直接在html里就可以了啊,只需要使用script標(biāo)簽即可,如果在外面用,需要使用script src引用(我百度半天,沒看到答案,也沒把自己的問題問清楚,在這里看到了答案,不錯)
2020-04-23
//定義"取消設(shè)置"的函數(shù)
function exit(){
var text = document.getElementById("txt");
var flag = confirm("取消設(shè)置");
if(flag == true){
text.removeAttribute("style")
}
}
function exit(){
var text = document.getElementById("txt");
var flag = confirm("取消設(shè)置");
if(flag == true){
text.removeAttribute("style")
}
}
2020-04-20
唉,慕課題目判斷是不是有問題?js‘’和”“區(qū)不區(qū)分都沒關(guān)系的吧,害我還以為哪里錯了
2020-04-09
2-7
<script type="text/javascript">
function openWindow(){
confirm("打開網(wǎng)站嗎?");
var mychar=prompt("輸入網(wǎng)站吧!","http://idcbgp.cn/");
window.open(mychar,"_blank","width=400,height=500,menubar=no,toolbar=no"); }
</script>
</head>
<script type="text/javascript">
function openWindow(){
confirm("打開網(wǎng)站嗎?");
var mychar=prompt("輸入網(wǎng)站吧!","http://idcbgp.cn/");
window.open(mychar,"_blank","width=400,height=500,menubar=no,toolbar=no"); }
</script>
</head>
2020-03-26