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

js跳轉到指定url的方法與實際使用

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

js跳轉到指定url

js怎么跳轉到指定url方法如下:

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

JS跳轉鏈接的幾種方式:

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

實際使用

需求:頁面上點擊按鈕 需要調用設備提供的地址

      <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"
      }
    },

總結 

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

您可能感興趣的文章:

相關文章

最新評論

广西| 九寨沟县| 鄂托克旗| 余姚市| 唐河县| 邛崃市| 西平县| 延川县| 天台县| 正安县| 合江县| 徐汇区| 济南市| 类乌齐县| 怀安县| 尼勒克县| 晋宁县| 安新县| 沾益县| 湾仔区| 合作市| 鄱阳县| 福安市| 榆社县| 阿城市| 太湖县| 宣武区| 思南县| 资兴市| 兴海县| 山东省| 达尔| 东平县| 曲阳县| 苏州市| 资中县| 平阳县| 定远县| 诸城市| 安多县| 庐江县|