From 1c87a7e8f130c58ae6ac4dc31648e4399600c34e Mon Sep 17 00:00:00 2001 From: remy Date: Mon, 23 Aug 2010 17:55:18 +0100 Subject: [PATCH] Removing the test - since actually I can't setAttribute on the window object - DOH! --- demos/history.html | 2 +- js/h5utils.js | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/demos/history.html b/demos/history.html index 306d08d..671564b 100644 --- a/demos/history.html +++ b/demos/history.html @@ -60,7 +60,7 @@ function reportData(data) { }); } -if (typeof history.pushState === 'undefined' || !isEventSupported('popstate')) { +if (typeof history.pushState === 'undefined') { state.className = 'fail'; } else { state.className = 'success'; diff --git a/js/h5utils.js b/js/h5utils.js index b78a781..3e2ede6 100644 --- a/js/h5utils.js +++ b/js/h5utils.js @@ -1,16 +1,6 @@ // For discussion and comments, see: http://remysharp.com/2009/01/07/html5-enabling-script/ /*@cc_on'abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video'.replace(/\w+/g,function(n){document.createElement(n)})@*/ -function isEventSupported(event, element) { - element = element || window; - var ok = 'on'+event in element; - if (ok) return ok; - element.setAttribute('on' + event, ''); - ok = typeof(element['on'+event] == "function"); - element.removeAttribute('on' + event); - return ok; -} - var addEvent = (function () { if (document.addEventListener) { return function (el, type, fn) {