How best to show message that browser does not support HTML5 ltrangegt element

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

The element, which is not supported in IE below 9, is displayed as a default text-field in IE8. For my application, which also has intended text fields as well as other user controls, this is worse than displaying nothing or showing a “little red X icon”, as the user would be confused, at best!

Some ‘non-text’ HTML5 elements, such as and , pair with a closing tag that allows text between the tags to display a message to users whose browsers do not support these elements. (I wonder why doesn’t have this feature/form.)

Is there a simple way to get around this? (I’ve used conditionals of the form “if (navigator.userAgent.indexOf("MSIE")!=-1) …” previously to get around a different inter-browser issue, but that doesn’t specify the IE version, and I’m pretty hazy about that sort of detection method.)

(Greetings StackOverflowers – first-time poster here. Background: been self-teaching JavaScript magpie-like for a short time, after learning a little HTML/CSS, and have only a tiny amount of experience with other languages over the years.)

Answers

The problem you have here has been solved in a more general way:

There are libraries that help you with feature detection and with replacing elements with more modern versions on browsers that support them.

http://modernizr.com/ http://modernizr.com/

Javascript-Snippets that can be used as drop-in replacements for new features in old browsers are called poly-fills . What you are looking for is a poly-fill for the range element, e.g. this:

https://github.com/freqdec/fd-slider https://github.com/freqdec/fd-slider

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/28016067/how-best-to-show-message-that-browser-does-not-support-html5-range-element

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils