為什么是亂碼呀?
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript">?
? function openWindow(){
? ? var cf = confirm("是否打開");
? ? if(cf){
? ? ? ? prompt("確定打開的網(wǎng)址","http//idcbgp.cn/") ;
? ? ? ? window.open('http//idcbgp.cn/','_blank','width=400,height=500,menubar=no,toolbar=no')
? ? }
? }
? ? // 新窗口打開時(shí)彈出確認(rèn)框,是否打開
? ? // 通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2018-08-26
看一下你meta里的charset,為了避免所有亂碼問題,應(yīng)該采用UTF-8(國際編碼)。gbk這個(gè)翻譯家是我們國家的,通用性較差,遇到不會(huì)翻譯的就干脆亂翻譯啦~
2018-08-25
<meta charset="utf-8">
//把上面的標(biāo)簽添加<head>標(biāo)簽后面
2018-08-24