設(shè)想:能否在實(shí)現(xiàn)window。open()時(shí),再?gòu)棾鯽lert()調(diào)用的窗口?
<!DOCTYPE?HTML> <html> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"> <title>window對(duì)象</title> <script?type="text/javascript"> function?win() { ????window.open('http://www.wyu.edu.cn','_blank','width=600,height=400'); } //alert("歡迎來(lái)到五邑大學(xué)!"); </script> </head> <body> <form> <input?type="button"?value="點(diǎn)擊我,打開(kāi)新窗口"?onClick="win()"?/> </form> </body> </html>
因?yàn)闆](méi)有alert()單獨(dú)時(shí),總是彈出警告窗口,非常麻煩,就是如何能夠好地實(shí)現(xiàn)alert()的調(diào)用,而又不會(huì)使其經(jīng)常彈出,只有當(dāng)點(diǎn)擊的時(shí)候;當(dāng)然,除了放在函數(shù)里面,通過(guò)按鈕點(diǎn)擊調(diào)用這種方法,還有其他的方法嗎?
2016-09-03
alert ?只有需要才寫(xiě),不用的話可以注釋掉,也可以用document.write() 函數(shù),或者 可以在F12 debug 工具里面調(diào)試你要調(diào)試的值