jsp手機如何打開 手機上jsp文件怎么打開方式



文章插圖
jsp手機如何打開 手機上jsp文件怎么打開方式

文章插圖
window.open()
<button id="go">點擊我</button><script>document.getElementById("go").addEventListener("click", () => {openUrl("https://so.toutiao.com/search?dvpf=pc&keyword=Plzbefat");});function openUrl(url) {window.open(url);}</script>
【jsp手機如何打開 手機上jsp文件怎么打開方式】a標簽
<a target="_blank">點擊我</a>
a 標簽自帶部分樣式 , 點擊過后會有顏色差
target參數詳解:
_self: 新網頁在當前的頁面打開,不填參數則就是當前頁面打開 。_blank: 新網頁在新窗口打開 。_parent: 沒有iframe的話在當前的頁面打開 。_top: 沒有iframe的話 在當前的頁面打開 。什么時候用a標簽什么時候用window.open?
一般使用a標簽是不需要帶上js邏輯的 , 這樣使用起來簡單明了 , 其余情況就使用 window.open() 就可以啦.
但是目前大多數使用 a 標簽的時候 , 都覺得它原有的樣式太丑 , 所以覆蓋樣式也是基本操作 .
css 對a標簽的樣式覆蓋:
<style>/* 未點擊過鏈接*/a:link {color: red;}/* 已經點擊過鏈接 */a:visited {color: green;}/* 鼠標移動到a標簽上方 */a:hover {color: hotpink;}/* 按住不放鏈接的時候 */a:active {color: blue;}/* a標簽的下劃線 */a {text-decoration: none;}</style><a target="_blank">[email protected]</a>
看看顏色和下劃線