第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

大神們幫忙看下, location.[方法] 在函數(shù)塊為什么報undefined?換成 location.[屬性] 就可以

<script type="text/javascript">

function locationTest(){

? var h_assign=location.assign('https://developer.mozilla.org/zh-CN/docs/Web/API/Location/assign');

? document.write("返回新的文檔方法:"+ h_assign);?


? var h_pathname=location.pathname;

? document.write("<br>" + "返回URL路徑:"+ h_pathname );

}

</script>

<input type="button" value="按鈕" onclick="locationTest()">


正在回答

2 回答

location.assign()是加載網(wǎng)頁。。沒有返回值吧?

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

bestMan 提問者

恩恩,把location.assign()賦值變量,順序換了下就可以了。 <script type="text/javascript"> var h_assign; function locationTest(){ location.assign('http://www.baidu.com')=h_assign; document.write("返回新的文檔方法:"+ h_assign); } </script> <input type="button" value="按鈕" onclick="locationTest()"> ?
2019-08-20 回復(fù) 有任何疑惑可以回復(fù)我~

順序調(diào)換,你確定能運行?

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

大神們幫忙看下, location.[方法] 在函數(shù)塊為什么報undefined?換成 location.[屬性] 就可以

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號