c#   浏览器区别

思路:浏览器本身独有的属性来区别:

 

1.window对象的属性来区别:           

window.attachEvent               IE
window.addEventListener       chrome
window.ActiveXObject;           IE

window.MessageEvent           Chrome 和 firefox
window.openDatabase           Safari

2.js来区别:

navigator.userAgent.indexOf("MSIE")>0      IE

navigator.userAgent.indexOf("chrome")>0   chrome

navigator.userAgent.indexOf("firefox")>0    firefox

 

document.getBoxObjectFor      firefox    Chrome无
document.all ;                          IE

 

相关文章:

  • 2021-11-23
  • 2021-09-29
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
猜你喜欢
  • 2021-07-15
  • 2022-01-14
  • 2021-09-27
  • 2021-07-22
  • 2021-12-16
  • 2021-11-23
相关资源
相似解决方案