This file contains hidden or 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 btn = document.querySelector('button'), | |
| var url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=AbeR1WOW3cRfDDrNytORuESZ6gp9MAJFt6-WKeZz3WbI70GDf_Tx_rXAR-UULcOn2mH8WXLqDtRmmuXSlwo4hYWiC5BWQNe8GTu1xC0_Zyt7PONWBuHJoWaJknt1qc1lQGHfACADTU " | |
| var o = { | |
| "touser": "oGHAIwfSjOqfDMDMq4zgFGAIXfGs", | |
| "msgtype": "text", | |
| "text": { | |
| "content": "Hello World boy" | |
| } | |
| } |
This file contains hidden or 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> | |
| <title> | |
| <%= title %> | |
| </title> | |
| <link rel='stylesheet' href='/stylesheets/style.css' /> | |
| </head> |
This file contains hidden or 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
| // 如果 不放在 window.onload里, 在 onload之前执行。 | |
| // 如果放在 setTimeout里,可以在onload之后执行。 | |
| //后续代码依赖loadScript加载代码时,将后续代码放在callback中 | |
| //多数浏览器,返回的代码会立即执行(Firefox、Opera,会等待此前所有动态节点执行完毕) | |
| //个人理解,动态节点:通过loadScript 加载的就算里一个动态节点。 | |
| function loadScript(url, callback) { | |
| var script = document.createElement("Script"); |
This file contains hidden or 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
| if (ev && ev.stopPropagation) { | |
| ev.stopPropagation(); | |
| } else { | |
| window.event.cancelBubble = true; | |
| } |
This file contains hidden or 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
| @mixin clear{ | |
| &:before,&:after{ | |
| content:' '; | |
| display: table; | |
| } | |
| &:after{ | |
| clear: both; | |
| } | |
| } | |
| $one-rem:36; |
This file contains hidden or 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
| function hasClass(ele, cls) { | |
| return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')); | |
| } | |
| function addClass(ele, cls) { | |
| if (!hasClass(ele, cls)) ele.className += " " + cls; | |
| } | |
| function removeClass(ele, cls) { | |
| if (hasClass(ele, cls)) { |