Thanks to Perfection kills, we can use the following JavaScript to detect event support:  function hasEvent(ev) {     var elem = document.createElement('a'),         type = 'on' + ev,         supported = elem[type] !== undefined;...
Different web browsers handle the window.close() function differently. IE prompts the user for confirmation, while Firefox and Safari just fail to honor it unless the window was originally opened with Javascript and display a message saying as much i...
Can we detect whether a browser supports dropping a file over an <input type="file" />?    For example, this is possible in Chrome but not in IE8.  Modernizr.draganddrop is a possibility but is it the right choice?  I'm not adding a...
I'm really enjoying ES6 generators. Is there a way I can detect generator support in browsers? I know generators might not be in a lot of browsers (or possible no browsers at all) at the moment, but that's OK for my purposes.   I tried:  try...
Internet Explorer does not support the data uri scheme for iframe urls (see http://msdn.microsoft.com/en-us/library/cc848897%28v=vs.85%29.aspx). Other browsers do. As browser detection is loaded with testing and future-proofing problems, I want to us...
When researching JavaScript conditional comments for IE, I stumbled upon @cc_on.  This seems to work.  However, the wikipedia entry on conditional comments provides the following code for more robust IE detections, specifically IE6:   /*@cc_on     @i...
I'm a keen advocate of feature detection opposed to device detection.  I'd like to be able to detect whether a browser (mobile or otherwise) supports Silverlight.  I've had a good google and found this Silverlight supported user agent but...
A client recently asked me to implement a slideshow on our website. I'm concerned that constantly animating picture transitions on the homepage will peg the processor of most mobile devices, so I want to disable the automatic advancing to preserv...
While searching for a way to check CSS support in browsers I came across two different approaches: CSS and JavaScript. I have used JS before for checking feature support in browsers, but not for CSS properties. From what I can tell newer browsers hav...
So, according to this article, you can feature test for canvas blend modes using:  Modernizr.addTest('canvasblending', function () {    if (Modernizr.canvas === false) return false;    var ctx = document.createElement('canvas').getCon...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.