{"id":74,"date":"2013-02-08T00:38:38","date_gmt":"2013-02-08T00:38:38","guid":{"rendered":"https:\/\/adeelejaz.com\/blog\/?p=74"},"modified":"2016-01-12T23:58:48","modified_gmt":"2016-01-12T23:58:48","slug":"jquery-browser-as-a-separate-file","status":"publish","type":"post","link":"https:\/\/adeelejaz.com\/blog\/jquery-browser-as-a-separate-file\/","title":{"rendered":"jQuery $.browser detection as a Separate File"},"content":{"rendered":"<p>As jQuery has <a href=\"http:\/\/jquery.com\/upgrade-guide\/1.9\/#jquery-browser-removed\">removed $.browser<\/a> from the versions &gt; 1.9.0, I found myself extracting it to be used in my own projects that depended on the feature.<\/p>\n<p>jQuery does provide <a href=\"https:\/\/github.com\/jquery\/jquery-migrate\/\">jQuery Migrate plugin<\/a> which includes the following code, but it also includes a lot of other things you might not need. I saw a couple of requests on the <a href=\"http:\/\/blog.jquery.com\/2013\/02\/04\/jquery-1-9-1-released\/comment-page-1\/#comment-536404\">official blog<\/a> and thought I&#8217;d put this live in case it helps anyone else.<\/p>\n<p><b>Note:<\/b> I highly recommend using tools like <a href=\"http:\/\/modernizr.com\">Modernizr<\/a> for feature detection. Only use $.browser if you really need to detect the browser vendor!<\/p>\n<p>Gist: <a href=\"https:\/\/gist.github.com\/adeelejaz\/4714079\">https:\/\/gist.github.com\/adeelejaz\/4714079<\/a><\/p>\n<p><script src=\"https:\/\/gist.github.com\/adeelejaz\/4714079.js\"><\/script><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content --><p class=\"wp-flattr-button\"><a href=\"https:\/\/adeelejaz.com\/blog\/?flattrss_redirect&amp;id=74&amp;md5=07fca06068a255c0adf52f031dbfa8be\" title=\"Flattr\" target=\"_blank\"><img src=\"https:\/\/adeelejaz.com\/blog\/wp-content\/plugins\/flattr\/img\/flattr-badge-white.png\" srcset=\"https:\/\/adeelejaz.com\/blog\/wp-content\/plugins\/flattr\/img\/flattr-badge-white.png, https:\/\/adeelejaz.com\/blog\/wp-content\/plugins\/flattr\/img\/flattr-badge-white@2x.png 2xhttps:\/\/adeelejaz.com\/blog\/wp-content\/plugins\/flattr\/img\/flattr-badge-white.png, https:\/\/adeelejaz.com\/blog\/wp-content\/plugins\/flattr\/img\/flattr-badge-white@3x.png 3x\" alt=\"Flattr this!\"\/><\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>As jQuery has removed $.browser from the versions &gt; 1.9.0, I found myself extracting it to be used in my own projects that depended on the feature. jQuery does provide jQuery Migrate plugin which includes the following code, but it also includes a lot of other things you might not need. I saw a couple [&hellip;]<!-- AddThis Advanced Settings generic via filter on wp_trim_excerpt --><!-- AddThis Share Buttons generic via filter on wp_trim_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-jquery-image-resize-plugin"],"_links":{"self":[{"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/comments?post=74"}],"version-history":[{"count":1,"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":75,"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/posts\/74\/revisions\/75"}],"wp:attachment":[{"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adeelejaz.com\/blog\/wp-json\/wp\/v2\/tags?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}