亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么我提交之后是undefined

<!DOCTYPE?HTML>
<html>
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8">
<title>location</title>
</head>
?<script?type="text/javascript">
?????document.write(window.location.herf);
?</script>
</head>
<body>
</body>
</html>


正在回答

3 回答

href寫錯了……

2 回復 有任何疑惑可以回復我~
#1

Ticvory 提問者

非常感謝!
2016-11-03 回復 有任何疑惑可以回復我~

因為你window.location.herf屬性沒有定義,屬性未定義則輸出undefined;

在之前加上定義就好了

<!DOCTYPE?HTML>
<html>
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8">
<title>location</title>
</head>
?<script?type="text/javascript">
?????window.location.herf="????//定義屬性?
?????document.write(window.location.herf);
?</script>
</head>
<body>
</body>
</html>


0 回復 有任何疑惑可以回復我~

沒有定義變量

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么我提交之后是undefined

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號