Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix directory.html for IE friendly :) #705

Merged
merged 1 commit into from

2 participants

@JacksonTian
  1. The missing DOCTYPE will trigger quirks mode when under IE
  2. The IE haven't addEventListener, use attachEvent instead.
@tj tj merged commit 3055802 into senchalabs:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 7, 2012
  1. @JacksonTian
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/public/directory.html
View
9 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){
Something went wrong with that request. Please try again.