Skip to content

Commit

Permalink
graceful handling of modernizr's death in the test
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Mar 11, 2010
1 parent 5a34b2c commit 61a592c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions modernizr-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<script>
// callback for the fontface detect
Modernizr._fontfaceready && Modernizr._fontfaceready(function(bool){
window.Modernizr && Modernizr._fontfaceready && Modernizr._fontfaceready(function(bool){
var elem = document.getElementById('fontface');

if (!elem) return;
Expand Down Expand Up @@ -71,7 +71,13 @@ <h1>Modernizr</h1>

<ol >
<script>
for (var prop in Modernizr) {
(function(){
if (!window.Modernizr) {
document.write('Modernizr object not created.');
return;
}

for (var prop in Modernizr) {
if (typeof Modernizr[prop] === 'function') continue;
if (prop == 'inputtypes' || prop == 'input') {
document.write('<li><b>'+prop+'{}</b><ul>');
Expand All @@ -84,7 +90,9 @@ <h1>Modernizr</h1>
}
}



})();

</script>
</ol>

Expand Down

0 comments on commit 61a592c

Please sign in to comment.