Permalink
Browse files

Merge pull request #705 from JacksonTian/fix_ie

Fix directory.html for IE friendly :)
  • Loading branch information...
2 parents 17b1003 + 483c93f commit 3055802016c40eedf7b26840d1ad993729f907c2 @tj tj committed Dec 7, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/public/directory.html
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
<html>
<head>
<title>listing directory {directory}</title>
@@ -9,8 +10,12 @@
: id;
el.on = function(event, fn){
- if ('content loaded' == event) event = 'DOMContentLoaded';
- el.addEventListener(event, fn, false);
+ if ('content loaded' == event) {
+ event = window.attachEvent ? "load" : "DOMContentLoaded";
+ }
+ el.addEventListener
+ ? el.addEventListener(event, fn, false)
+ : el.attachEvent("on" + event, fn);
};
el.all = function(selector){

0 comments on commit 3055802

Please sign in to comment.