Rails 3 uses HTML5 features. Do I need to do something for older browsers?
Ma开发者_如何学JAVAny people still use IE 6 and other lower version browser. HTML5 is new, many browsers don't fully support it.
If I want to use Rails 3, do I need to do some extra work?
Scaffolding templates in Rails 3 use the HTML5 DOCTYPE by default and HTML5 custom data attributes are used to support Unobtrusive JavaScript (the Rails' helpers no longer render inline JavaScript).
Neither of these features will break IE6, at worst it will simply ignore them. You're probably going to have to do some extra work to get your JavaScript working.
It depends what HTML5 features Rails 3 uses.
I’m not sure which features those are, but as far as possible, HTML5 has been designed to work well in older browsers. For example:
- the HTML5 doctype (
<!DOCTYPE html>
) works just fine in old browsers - new HTML5 form fields (e.g.
<input type="date">
) just render as text inputs in browsers that don’t support them - HTML5 data attributes don’t hurt older browsers
You might want to include or write a JavaScript library that simulates HTML5 features in older browsers. HTML5shim, for example, makes the new HTML5 elements (like <section>
and <article>
) work in earlier versions of IE.
Rails 3 doesn't tie you to HTML 5. HTML 5 wasn't even invented when rails 3 came out. The main issues with IE6 are to do with styling and javascript. For styling you just need a designer who knows what they are doing. For javascript its recommended to use a library like jQuery for all of your js needs as jQuery is fully browser compatible in the way that it operates.
精彩评论