IFE-2016-SP-task17 AQI Histogram

My Solution

My solution to task17 is available on jsfiddle:

Compared with others’

In top-three team solutions to this task, the third one is very similar to my solution except for the code snippet below:

1
2
3
4
5
6
7
8
9
10
//跨浏览器事件绑定
function addEventHandler(ele, event, hanlder) {
if (ele.addEventListener) {
ele.addEventListener(event, hanlder, false);
} else if (ele.attachEvent) {
ele.attachEvent("on"+event, hanlder);
} else {
ele["on" + event] = hanlder;
}
}

which also takes browser compatibilities into consideration. Note that: attachEvent is for IE and addEventListener is for the others.

To Do

  • to do study in the near future.