為什么打不開網(wǎng)址
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>無標題文檔</title>
</head>
<body>
<script type="text/javascript">
var body=document.body;
function createa(url,text)
{
? ??
? ? var a=document.createElement("a");
? ? a.href=url;
? ? a.innerHTML=text;
? ? a.style.color="red";
? ? body.appendChild(a);
}
// 調(diào)用函數(shù)創(chuàng)建鏈接
createa("http://idcbgp.cn/","慕課網(wǎng)");
</script>?
</body>
</html>
2019-07-08
http://idcbgp.cn/改成http://idcbgp.cn/就可以了。報錯里有提示的。