function openwindow(){
var url = 'http://baidu.com';
var conBox = confirm('確認打開窗口嗎?');
if (conBox == true) {
var proBox = prompt('請輸入要打開的網址',url);
if (proBox != null) {
window.open(url,'_blank',"width=400,height=500,menubar=no,toolbar=no");
}
}else{
alert('退出成功');
}
}
var url = 'http://baidu.com';
var conBox = confirm('確認打開窗口嗎?');
if (conBox == true) {
var proBox = prompt('請輸入要打開的網址',url);
if (proBox != null) {
window.open(url,'_blank',"width=400,height=500,menubar=no,toolbar=no");
}
}else{
alert('退出成功');
}
}
function openWindow()
{
var newwindow = confirm("xxx");
if(newwindow == true)
{
var url = prompt("xxx:","http://www.xianlaiwan.cn");
if(url == "http://www.xianlaiwan.cn")
{ window.open('http://www.xianlaiwan.cn/','_blank','width=400,heigth=500,menubar=no,toolbar=no');}}
{
var newwindow = confirm("xxx");
if(newwindow == true)
{
var url = prompt("xxx:","http://www.xianlaiwan.cn");
if(url == "http://www.xianlaiwan.cn")
{ window.open('http://www.xianlaiwan.cn/','_blank','width=400,heigth=500,menubar=no,toolbar=no');}}
function openWindow()
{
var con=confirm("是否打開");
if(con==true)
{
var add=prompt("請輸入網址","http://www.xianlaiwan.cn");
window.open(add,'_blank','width=300,height=500,menubar=no,toolbar=no,status=no,scrollbars=yes');
}}
注意符號和字母拼寫,還有語法的邏輯就能寫出來了??!
{
var con=confirm("是否打開");
if(con==true)
{
var add=prompt("請輸入網址","http://www.xianlaiwan.cn");
window.open(add,'_blank','width=300,height=500,menubar=no,toolbar=no,status=no,scrollbars=yes');
}}
注意符號和字母拼寫,還有語法的邏輯就能寫出來了??!
function openWindow(){
var flag = confirm("是否打開一個新的窗口");
if(flag == true){
var url = prompt("請輸入打開的網址");
if(url != null){
window.open(url,'_blank','width= 400,height=500,menutar=no,toolbar=no');
}
}
}
var flag = confirm("是否打開一個新的窗口");
if(flag == true){
var url = prompt("請輸入打開的網址");
if(url != null){
window.open(url,'_blank','width= 400,height=500,menutar=no,toolbar=no');
}
}
}
//定義"取消設置"的函數
function unset(){
var check = confirm('是否取消設置');
if(check){
var ele = document.getElementById('txt');
ele.style = '';
}
}
function unset(){
var check = confirm('是否取消設置');
if(check){
var ele = document.getElementById('txt');
ele.style = '';
}
}
只要在編輯器里運行下面這段代碼, 相信我, 你會打開新世界的大門!
function Wopen(){
while(true){
window.open('http://www.xianlaiwan.cn','_blank','width=600,height=400,menubar=no,toolbar=no, status=no,scrollbars=yes')
}
}
function Wopen(){
while(true){
window.open('http://www.xianlaiwan.cn','_blank','width=600,height=400,menubar=no,toolbar=no, status=no,scrollbars=yes')
}
}
2020-01-04
被Java虐過一遍的人剛開始學起JavaScript的時候:
"握草!
變量var?八大基本類型精簡版?
函數?這不就是方法嘛,訪問權限修飾符呢,有參無參,有返無返?
document.write()?System.out.print?
......
得了,跳躍式學習,記住一些改變了的東西,一天內學完全是沒問題了
".
"握草!
變量var?八大基本類型精簡版?
函數?這不就是方法嘛,訪問權限修飾符呢,有參無參,有返無返?
document.write()?System.out.print?
......
得了,跳躍式學習,記住一些改變了的東西,一天內學完全是沒問題了
".
2020-01-04
//定義"取消設置"的函數
function notDo(){
confirm("是否取消?");
if(confirm=true){
let info = document.getElementById("txt")
info.style="none";
let info0 = document.getElementById("con")
info0.style="none";
}
}
function notDo(){
confirm("是否取消?");
if(confirm=true){
let info = document.getElementById("txt")
info.style="none";
let info0 = document.getElementById("con")
info0.style="none";
}
}
輸出null是沒有被識別,沒有找到這個對象,你可能沒有添加"",必須框起來他才會認為是對象,然后輸出object HTMLParagraphElement,但你如果這樣輸出mychar. innerHTML,它會直接返回一個JavaScript
2019-12-17