iT邦幫忙

0

[已解決] 瀏覽器類別 與 連結方式

瀏覽器類別 與 連結方式
請問在網頁連結有方法依不同瀏覽器使用不同連結嗎?
如 Chrome 使用
a href="javascript:POBrowser.openWindowModeless('Excel.php?var1=/1.xls','width=1200px;height=800px;');">Chrome連結方式)</a

如 IE 使用
a target="right" href="Excel.php?var1=/1.xls">ABM.rar</a

要如何使用語法
謝謝

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

2 個回答

0
㊣浩瀚星空㊣
iT邦大神 1 級 ‧ 2019-05-09 13:49:07
最佳解答

你不是已經知道 javascript: 的用法了。
依樣處理就好了。

再不行的話。你可以看看你的後端程式是什麼,拿它來做辨識輸出就行了吧。

chare168 iT邦新手 5 級 ‧ 2019-05-10 10:29:09 檢舉

目前使用如下 代碼: 可以指定轉跳成功
謝謝 大家幫忙

<script type="text/javascript">  

    var isSafari = navigator.userAgent.search("Safari") > -1; //Google瀏覽器是用這核心 
	
 if (isSafari) {    
		window.location.href = 'Google.php';
    }  
	else {  
       window.location.href = 'IE.php'; 
    }  
</script>
0
dragonH
iT邦超人 5 級 ‧ 2019-05-09 14:19:08

先用

navigator.userAgent

來判斷使用者的瀏覽器

在依判斷結果回傳值給你的 DOM

chare168 iT邦新手 5 級 ‧ 2019-05-10 10:29:22 檢舉

目前使用如下 代碼: 可以指定轉跳成功
謝謝 大家幫忙

<script type="text/javascript">  

    var isSafari = navigator.userAgent.search("Safari") > -1; //Google瀏覽器是用這核心 
	
 if (isSafari) {    
		window.location.href = 'Google.php';
    }  
	else {  
       window.location.href = 'IE.php'; 
    }  
</script>

我要發表回答

立即登入回答