Removing the test - since actually I can't setAttribute on the window object - DOH!
This commit is contained in:
parent
237b024023
commit
1c87a7e8f1
|
@ -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';
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue