Questions tagged [modernizr]

Modernizr is an open-source JavaScript library that helps you build the next generation of HTML5 and CSS3-powered websites.

Modernizr is a small JavaScript library that detects the availability of native implementations for next-generation web technologies, most commonly features that stem from the HTML5 and CSS3 specifications. Many of these features are already implemented in at least one major browser (most of them in two or more). Modernizr tells you whether the current browser has this feature natively implemented or not.

The most recent version of Modernizr is Modernizr 2.5, released 6 Feb 2012. More information is available at the Modernizr home page.

When Modernizr v2 was released in June 2011, it made a significant departure from v1 (and from most other common JavaScript libraries): Where version 1 included all the feature detection tests in a single standard script, version 2 allows a site developer to build their own personalized copy of Modernizr that contains only the tests required. This allows a developer to minimize the amount of JavaScript code that their users need to download. However, it also reduces the scope to use a shared content delivery network (CDN) such as Google Code.

902 questions
550
votes
7 answers

What is the purpose of the HTML "no-js" class?

I notice that in a lot of template engines, in the HTML5 Boilerplate, in various frameworks and in plain php sites there is the no-js class added onto the tag. Why is this done? Is there some sort of default browser behavior that reacts to…
Swader
  • 11,387
  • 14
  • 50
  • 84
113
votes
3 answers

HTML5shiv vs Dean Edwards IE7-js vs Modernizr - which to choose?

I'm looking to build my first HTML5 site and have been looking at working with IE. There is html5shiv, Dean Edwards ie7-js and then Modernizr. Are these all largely the same? I'm confused about which route to go.
PaulM
  • 3,281
  • 3
  • 28
  • 38
85
votes
9 answers

Correct way to use Modernizr to detect IE?

I wanted to use the Modernizr JS library to detect for some browser properties to determine what content to show or not show. I have an app called Pano2VR which outputs both HTML5 and SWF. I need the HTML5 for iOS device users. However, IE does not…
Steve
  • 14,401
  • 35
  • 125
  • 230
63
votes
4 answers

should Modernizr file be placed in head?

Should the reference to the Modernizr JavaScript file be in the head of the page? I always try and place all scripts on the bottom of the page and would like to preserve this. And if it needs to be in the head, why?
amateur
  • 43,371
  • 65
  • 192
  • 320
49
votes
3 answers

Modernizr, html5shiv, ie7.js, and CSS3 Pie. Which to use and when?

I'm just starting to use HTML5 and CSS3 in my documents. I understand the need for JavaScript to bring Internet Explorer up to speed with these new tags and styles, but I don't know which to use and when! My plan was to use html5shiv and IE9.js to…
stefmikhail
  • 6,877
  • 13
  • 47
  • 61
48
votes
2 answers

Click to call html

I want to use html5 tag in my website for mobile view when user click on this link from mobile device it will place a call on the given number..

Book now, call 01234 567 890

What should I do to hide this link…
Umair Rana
  • 683
  • 1
  • 6
  • 13
46
votes
1 answer

If I'm already using Modernizr, will I then even need HTML5 Shiv?

1) If I'm already using Modernizr, will I then even need HTML5 Shiv to enable HTML5 tag support for IE? 2) Is HTML5 Shiv only for IE, or for all browser who don't have native HTML 5 support? Like older versions of Firefox, Safari, Chrome, etc?
Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852
45
votes
3 answers

Modernizr with Respond.js

I am carefully assessing the best way to utilize Modernizr and Respond.js for responsive design and have a couple of questions for the community. Firstly, it is my understanding that when bundling Modernizr with Respond.js, no other coding or tests…
dropseed
  • 451
  • 1
  • 4
  • 4
42
votes
4 answers

Using Modernizr to test for tablet and mobile - Opinions wanted

I want to use Modernizr to detect whether a user is view a site on a desktop, tablet or mobile device. My initial first thoughts are obviously to check screen sizes that should be enough for mobile devices and also for larger desktops. For tablet…
mtwallet
  • 5,040
  • 14
  • 50
  • 74
40
votes
1 answer

Is okay to implement Modernizr with Twitter Bootstrap?

Is it OK to implement Modernizr with Twitter Bootstrap? I'm currently using Bootstrap with Google's html5shiv and I wanted to know if I can use Modernizr instead or is it overkill just to get HTML5 elements activated for older IE browsers? Thanks in…
Wasabi Developer
  • 3,523
  • 6
  • 36
  • 60
39
votes
2 answers

Understanding Modernizr benefits over html5shiv

I know there's a lot of good questions on the site about these two script libraries. I wanted to ask something that I can't seem to find in any of them though. What does Modernizr provide that html5shiv doesn't out of the box, that is, just…
bevacqua
  • 47,502
  • 56
  • 171
  • 285
35
votes
2 answers

Is Modernizr really needed if you're not using the feature detection?

I keep jumping into projects where Modernizr is located in the head, but it isn't being used (at least for feature detection). Now, I love Modernizr, I use it frequently for feature detection and fallbacks on projects that require it; however, the…
darcher
  • 3,052
  • 3
  • 24
  • 29
31
votes
2 answers

Modernizr Causes Content Security Policy (CSP) Violation Errors

I am attempting to use the new Content Security Policy (CSP) HTTP headers on a test site. When I use CSP in conjunction with Modernizr I get CSP violation errors. This is the CSP policy I am using: Content-Security-Policy: default-src 'self';…
Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311
31
votes
4 answers

jquery 1.9.0 and modernizr cannot be minified with the ASP.NET Web Optimization Framework

We are using the ASP.NET Web Optimization Framework with bundles and minification. One bundle just contains jquery and modernizr. This all worked fine with jquery 1.8.3 but since we updated to 1.9.0 the combination jquery/modernizer bundle is not…
Remy
  • 12,555
  • 14
  • 64
  • 104
22
votes
5 answers

How to get html element's class tags

I'm using a custom modernizer config which has selected the features I employ in my page (and only those features). So, I'd like to simply grab the className of the of the page so I can check to see how many no- prefixed classes are present…
Steven Lu
  • 41,389
  • 58
  • 210
  • 364
1
2 3
60 61