browser-detection

Detect IE9 without feature detection

流过昼夜 提交于 2019-12-10 23:38:24
问题 So I need to detect IE 9. I know I should really use feature detection but I don't know what feature is causing my issue all I know is that Ie 9 is causing me issues. I've got a work around to my issue (for those interested I asked a question about the problem here but really, it is irrelevant). Now I want to implement this hack fix only for IE9 as this is what's causing me the headache. So how is the best way to detect IE 9? 回答1: These IE conditionals will give you a CSS class to key-off-of:

Detecting IE version not considering compatibility mode

ぃ、小莉子 提交于 2019-12-10 19:27:31
问题 I'm trying to figure out if it's possible to detect what version of IE you are using, and not your document-mode. It can be server or client-code (doesn't matter), I just need to know what version of IE the user has installed. 回答1: It could be detected in both, by examining the User-Agent string. Note that browsers can spoof their UA string, but this is rarer now than in the past. See this article on MSDN for older UA strings. Note also that IE8 sends a different UA string in Compatibility

Google Chrome inset box-shadow bug on Windows, not on Mac: Better workaround?

情到浓时终转凉″ 提交于 2019-12-10 13:25:41
问题 This is still current on Chrome 5.0.375.125, which is the latest Windows release at the time of this writing. Bug is tracked here: http://code.google.com/p/chromium/issues/detail?id=25334 So, the problem is, if you're on Windows or Linux, and someone uses inset box-shadow on an element that also has border-radius, you get a bug -- the border-radius is preserved, but the inset box-shadow spills out of it, as if it were still a square box. It works as expected in Chrome on Mac OS X. people

Detect iOS version with PHP

自古美人都是妖i 提交于 2019-12-10 11:13:59
问题 For detecting Internet Explorer I use his line. <?php if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) { };?> How do I detect iOS 5. 回答1: The HTTP_USER_AGENT will return the following: Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7 If you are trying to detect iOS 5, do the following: <?php if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone OS 5_0') !== false) { };?> 回答2: I had a similar

How to detect a browser that dosen't render .png transparency

痞子三分冷 提交于 2019-12-10 10:12:07
问题 I have this code that render's a image acording to the day of the week. But in IE6 and lower and probably some other browsers it won't render png opacity. So I want to change it a litle so that it will detect the browser's that don't render alpha transparency and tell them to load this image instead: "img/horarios2.png". Ive tried making it so that it would rule out IE6 and lower that are known for not rendering, but then I thinking about all the other browsers that I probably don't know

PHP get_browser: how to identify ie7 versus ie6?

好久不见. 提交于 2019-12-09 23:03:08
问题 Is there any way to differentiate IE7 versus IE6 using PHP's get_browser() function? 回答1: You can do so as such: $browser = get_browser(); if($browser->browser == 'IE' && $browser->majorver == 6) { echo "IE6"; } elseif($browser->browser == 'IE' && $browser->majorver == 7) { echo "IE7"; } A quick look to the official get_browser() documentation would of answered your question. Always read the documentation before. 回答2: I read that get_browser() is a relatively slow function, so I was looking

ASP.NET Browser definition files

微笑、不失礼 提交于 2019-12-09 12:58:00
问题 Can anyone recommend a good library of .browser definition files that is regularly updated? I've found both OceanSpiders from http://owenbrady.net/browsercaps/ and some definition files from http://aspnet.codeplex.com/releases/view/41420 but I'm not sure if either are regularly updated (the iPad isnt included for example). Thanks in advance Al 回答1: These definition files are "regularly" updated by Microsoft, and pushed through Windows Update. "Regularly" might mean years, though. A hotfix for

javascript date getYear() returns different result between IE and Firefox, how to approach this?

瘦欲@ 提交于 2019-12-09 10:14:44
问题 Apparently javascript date object's method getYear() returns different result between IE8 and Firefox3.6 (I have those 2 on my machine, not sure other browser or version) Date d = new Date(); alert(d.getYear()); FF3.6 ==> 111 (year since 1900? i guess) IE8 ===> 2011 I have been only testing on Firefox and now my Javascript code that adjust returned value of getYear() is now giving me 3911 because of my coding. var modified = d.getYear() + 1900 On Firefox it return 2011. But if I apply this

Using jquery.support to check for Firefox 3.5

孤街醉人 提交于 2019-12-08 10:05:12
问题 I'd like to use some CSS that is only supported by Firefox 3.5 at the moment (box-shadow: inset). For all the other browsers, via jQuery, I'll have to insert some extra divs with backgrounds to accomplish the effect. I'd like to 'reward' FF3.5 users and not bother with that bit of script if they support the CSS. It seems that the 'proper' way to test for a browser via jQuery is to use jQuery.support. However, I don't see/know of any particular feature I could test for that would be unique to

Detect tablet and smartphone

荒凉一梦 提交于 2019-12-08 08:32:25
问题 I would like to know, what is the best way to detect tablets and smartphone at the moment? Plugin, user agent detection, touch screen detection etc. Thanks 回答1: Look at the top rated answer at this url: What is the best way to detect a mobile device in jQuery? Current methods from that thread: var isMobile = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/); Jquery: $.browser.device = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent