Advertisement
jiue123

Kiễm tra browser version bằng javascript

Dec 30th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var str = navigator.appVersion,(lấy thông tin version browser hiện tại)
  2.     patt = new RegExp("MSIE 8.0"); (gán patt = versin IE8)
  3.     if(patt.test(str)){ (check nếu chuỗi str có chuỗi "MSIE8" thì sẽ thực hiện lệnh bên dưới)
  4.     $(".rh_main_menu ul li").css("line-height","22px");
  5.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement