browser-feature-detection

New Webkits convert decimal comma to ~ dot and vice versa in number-type inputs. Javascript name of that browser feature?

旧城冷巷雨未停 提交于 2019-11-26 17:49:38
问题 I found a most peculiar browser feature in the latest Chrome (35; Win/Android/iOS) and Safari (7; iOS) versions. If you have a math form with input type="number" and enter a number with a decimal comma, the browsers do the calculations with the number as if the comma were a dot. And if you enter numbers with decimal dots, they do their normal calculations, but the resulting figure is displayed with a decimal comma. That is, in my European (i.e. Dutch) version. I don't know about American

Check browser CSS property support with JavaScript?

你离开我真会死。 提交于 2019-11-26 07:28:44
问题 Is it possible in JavaScript to know if a CSS property is supported by the client browser? I\'m talking about the rotation properties of CSS3. I want to execute some functions only if the browser supports them. 回答1: I believe you can do it this way: if ('WebkitTransform' in document.body.style || 'MozTransform' in document.body.style || 'OTransform' in document.body.style || 'transform' in document.body.style) { alert('I can Rotate!'); } 回答2: There is a new DOM API CSS.supports for that

Detect if device is iOS

房东的猫 提交于 2019-11-25 22:01:12
问题 I\'m wondering if it\'s possible to detect whether a browser is running on iOS, similar to how you can feature detect with Modernizr (although this is obviously device detection rather than feature detection). Normally I would favour feature detection instead, but I need to find out whether a device is iOS because of the way they handle videos as per this question YouTube API not working with iPad / iPhone / non-Flash device 回答1: Detecting iOS I am not a fan of User Agent sniffing, but here