What’s the replacement for $.browser

Based on jQuery migration plugin , I found this. jQuery.uaMatch = function( ua ) { ua = ua.toLowerCase(); var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || /(webkit)[ \/]([\w.]+)/.exec( ua ) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || /(msie) ([\w.]+)/.exec( ua ) || ua.indexOf(“compatible”) < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || []; return { browser: match[ … Read more

Browser detection

if (Request.Browser.Type.Contains(“Firefox”)) // replace with your check { … } else if (Request.Browser.Type.ToUpper().Contains(“IE”)) // replace with your check { if (Request.Browser.MajorVersion < 7) { DoSomething(); } … } else { }

How do you detect support for VML or SVG in a browser

I’d suggest one tweak to crescentfresh’s answer – use document.implementation.hasFeature(“http://www.w3.org/TR/SVG11/feature#BasicStructure”, “1.1”) rather than document.implementation.hasFeature(“http://www.w3.org/TR/SVG11/feature#Shape”, “1.0”) to detect SVG. WebKit is currently very picky about reporting features, and returns false for feature#Shape despite having relatively solid SVG support. The feature#BasicStructure alternative is suggested in the comments to https://bugs.webkit.org/show_bug.cgi?id=17400 and gives me the answers I expected on … Read more

server-side browser detection? node.js

var ua = request.headers[‘user-agent’], $ = {}; if (/mobile/i.test(ua)) $.Mobile = true; if (/like Mac OS X/.test(ua)) { $.iOS = /CPU( iPhone)? OS ([0-9\._]+) like Mac OS X/.exec(ua)[2].replace(/_/g, ‘.’); $.iPhone = /iPhone/.test(ua); $.iPad = /iPad/.test(ua); } if (/Android/.test(ua)) $.Android = /Android ([0-9\.]+)[\);]/.exec(ua)[1]; if (/webOS\//.test(ua)) $.webOS = /webOS\/([0-9\.]+)[\);]/.exec(ua)[1]; if (/(Intel|PPC) Mac OS X/.test(ua)) $.Mac = /(Intel|PPC) … Read more

Best way to check for IE less than 9 in JavaScript without library

Javascript var ie = (function(){ var undef, v = 3, div = document.createElement(‘div’), all = div.getElementsByTagName(‘i’); while ( div.innerHTML = ‘<!–[if gt IE ‘ + (++v) + ‘]><i></i><![endif]–>’, all[0] ); return v > 4 ? v : undef; }()); You can then do: ie < 9 By James Panolsey from here: http://james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments

How to target Microsoft Edge with CSS? [duplicate]

To target Edge (version < 79), we can check for -ms-ime-align support, Edge being the only Microsoft browser that supports this property: @supports (-ms-ime-align: auto) { .selector { color: red; } } Or this one-liner (that one works on Edge and all IEs also): _:-ms-lang(x), .selector { color: red; } Further explanation, including variants to … Read more

tech