Detect Safari using jQuery

前端 未结 13 1630
面向向阳花
面向向阳花 2020-11-27 10:09

Though both are Webkit based browsers, Safari urlencodes quotation marks in the URL while Chrome does not.

Therefore I need to distinguish between these two in JS.

13条回答
  •  爱一瞬间的悲伤
    2020-11-27 10:29

    If you are checking the browser use $.browser. But if you are checking feature support (recommended) then use $.support.

    You should NOT use $.browser to enable/disable features on the page. Reason being its not dependable and generally just not recommended.

    If you need feature support then I recommend modernizr.

提交回复
热议问题