為什么我的碼打開imooc是亂碼?
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"/> ??
? <script type="text/javascript"> ?
? ? function openWindow(){
? ? // 新窗口打開時彈出確認框,是否打開
var confir=confirm("?");
if(confir==true){
? ? var webadd=prompt("?","http://idcbgp.cn/");
? ? window.open(webadd,"_blank","width=400,height=500,toolbar=no,menubar=no");
}
??
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
其他部分都沒有問題 但是打開http://idcbgp.cn/是亂碼
2018-07-18
亂碼是編碼不同導致的,你把第五行的"UTF-8"改為"gbk",gbk才是java的默認編碼
2018-07-18
換個瀏覽器試試?我用的谷歌瀏覽器,沒有亂碼現(xiàn)象