最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

js跳轉(zhuǎn)到指定url的方法與實(shí)際使用

 更新時(shí)間:2023年09月14日 08:57:18   作者:藍(lán)胖子的多啦A夢  
這篇文章主要給大家介紹了關(guān)于js跳轉(zhuǎn)到指定url的方法與實(shí)際使用的相關(guān)資料,要實(shí)現(xiàn)JavaScript跳轉(zhuǎn)到指定URL,可以使用window.location對(duì)象來實(shí)現(xiàn),需要的朋友可以參考下

js跳轉(zhuǎn)到指定url

js怎么跳轉(zhuǎn)到指定url方法如下:

1、οnclick="javascript:window.location.href='URL'"
2、οnclick="location='URL'"
3、οnclick="window.location.href='URL?id=11'"

JS跳轉(zhuǎn)鏈接的幾種方式:

1、跳轉(zhuǎn)鏈接在當(dāng)前窗口打開
window.location. rel="external nofollow"        
等價(jià)于
<a href="baidu.com" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  target="_self">go baidu</a>
2、跳轉(zhuǎn)鏈接 在新窗口打開
 window.open("http://www.baidu.com") 
等價(jià)于
<a href="baidu.com" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  target="_blank">go baidu</a>
3、跳轉(zhuǎn)鏈接 返回上一頁
window.history.back(-1);
4、跳轉(zhuǎn)鏈接
self.location.href="baidu.com" rel="external nofollow"  rel="external nofollow"  rel="external nofollow" 

實(shí)際使用

需求:頁面上點(diǎn)擊按鈕 需要調(diào)用設(shè)備提供的地址

      <el-button v-if="showBtn" size="mini" type="primary" @click="towBtn('openDebugger')">
        {{ $t("mlFive.openBugger") }}
      </el-button>
 towBtn(e) {
      if (e == 'openDebugger') {
        location.href = "device://config"
      } else {
        location.href = "device://release"
      }
    },

總結(jié) 

到此這篇關(guān)于js跳轉(zhuǎn)到指定url的方法與實(shí)際使用的文章就介紹到這了,更多相關(guān)js跳轉(zhuǎn)指定url內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論

三明市| 托克逊县| 河间市| 湘乡市| 四子王旗| 垣曲县| 双柏县| 东宁县| 平罗县| 三门县| 轮台县| 赣榆县| 东乌珠穆沁旗| 岐山县| 周宁县| 榆树市| 鸡西市| 周宁县| 建湖县| 香河县| 诸城市| 兴城市| 阜南县| 峨眉山市| 凉城县| 白山市| 东兰县| 潼南县| 沙坪坝区| 于田县| 岑溪市| 措勤县| 邵阳县| 永靖县| 华安县| 宽城| 平凉市| 年辖:市辖区| 新竹市| 鲁甸县| 清水河县|