Reputation: 1840
If I want to turn on new HTML5 tags in IE8 I can just use html5shiv, but how can I allow other HTML5 things like attributes (pattern, required, etc?). For <= IE7 I can just display the "Update your browser" message but IE8 is the latest possible for WinXP and default for Win7 so I need some of HTML5 attributes to be usable in it. Any idea how can I do it?
Upvotes: 1
Views: 65
Reputation: 168685
Many newer browser features can be emulated in older browsers by use of a polyfill script.
There are dozens of polyfills that have been written, mostly for old IE versions, that do the job for one feature or another (or in some cases multiple features).
Your job is to work out which polyfills to use.
There's a big list of scripts here -- browse through that list and find ones that might do what you need. (note: this list is supplied by the authors of Modernizr, which is a script designed to help you know which features the user's browser is missing, and therefore which polyfills you need to install; you'll probably want this script as well)
However, please remember that IE8, as well as missing a lot of features, is also a lot slower than modern browsers. Adding extra javascript libraries for missing features will make it even slower. This is fine if you only need to fix up a few features, but don't expect to be able to use a large number of polyfill scripts and magically turn IE8 into IE10.
Also, it's important to note that these scripts are just little tools that people have written to help themselves. Very often they may not work well together, or may not provide 100% compatibility with the real HTML5 feature. You need to try them out and be prepared to live with the shortcomings.
Finally, you should consider the option of simply leaving some things so users of old browsers get a degraded experience. If your site is still usable, then it's not a disaster for them to be missing the frills. Don't make a big noise about them having an incompatible browser (unless it really does break things); just let them see it a bit broken but still usable.
Upvotes: 6