This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pubSub = (function(){ | |
//以各种event为键,值为该event绑定的callback队列 | |
var eventQueues = {}; | |
//此处只发布event本身,不携带其它信息。 | |
//可稍作修改增加参数实现携带信息。 | |
function pub(event){ | |
if(!eventQueues[event]){ | |
//若发布event时没有该event对应的callback队列 | |
eventQueues[event] = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Hello World!</title> | |
<link rel="stylesheet" type="text/css" href="./styles.css"> | |
</head> | |
<body> | |
<h1>Hello World!</h1> | |
<input type="file" /> |
OlderNewer