window.location.href打开新窗口
时间: 2023-10-15 22:25:27 浏览: 116
window.location.href可以用来打开新窗口,具体的方法是将目标URL赋值给window.location.href属性。例如,使用window.location.href = "https://www.example.com"可以在新窗口中打开"https://www.example.com"网页。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [window.location.href的用法](https://blog.csdn.net/weixin_42228042/article/details/129236888)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [详解js location.href和window.open的几种用法和区别](https://download.csdn.net/download/weixin_38683895/13681348)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文