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
| <html> | |
| <head> | |
| <style> | |
| #log{ | |
| width : 600px; | |
| height : 400px; | |
| border : 1px solid red; | |
| margin-bottom : 10px; | |
| } | |
| </style> |
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 execCalc(aData) { | |
| var nMin = Number.MAX_VALUE; | |
| var nMax = Number.MIN_VALUE; | |
| for(var i = 0 ; i < aData.length; i++) { | |
| if(aData[i] < nMin) { | |
| nMin = aData[i]; | |
| }else if(aData[i] > nMax) { | |
| nMax = aData[i]; | |
| }else{} |
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
| header,nav,section,div,footer,ul,dd {margin:0;padding:0;} | |
| li{list-style: none;} | |
| dt { | |
| font-weight: bold; | |
| font-size: 1.2em; | |
| margin-bottom: 5px; | |
| } | |
| dl { | |
| float: left; |
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> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>qunit test</title> | |
| <link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css"/> | |
| </head> | |
| <body> | |
| <div id="qunit"></div> |
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> | |
| <meta charset="UTF-8"> | |
| <title>testcode</title> | |
| <style type="text/css" media="screen"> | |
| .testButton{width:400px;height:50px;} | |
| .showLayer{width:400px;height:400px;background:pink} | |
| .showLayer > div {padding: 10px; box-sizing: border-box; } | |
| </style> |
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> | |
| <meta charset="UTF-8"> | |
| <title>testcode</title> | |
| <style type="text/css" media="screen"> | |
| .testButton{width:400px;height:50px;} | |
| .showLayer{width:400px;height:400px;background:pink} | |
| .showLayer > div {padding: 10px; box-sizing: border-box; } | |
| </style> |
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 a = [1,2,3,4,5]; | |
| var b = [1,2,3,4,5]; | |
| a === b //false | |
| a.join('_') === b.join('_'); //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
| //thin 'Object.create()' | |
| function JClass(parentProto) { | |
| var fun = new Function(); | |
| fun.prototype = parentProto; | |
| return new fun(); | |
| } | |
| // Parent function | |
| function ESS(name) { | |
| this.comma = ","; |
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 TA() { | |
| this.ele = document.querySelector("#message"); | |
| this._attachEvents(); | |
| } | |
| TA.prototype = { | |
| _handlers : { | |
| click : '_clickHandler', | |
| mousedown : '_mousedownHandler', /* test */ | |
| touchstart: '_touchHandler',/* test */ |
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 arr = [1,2,3,[4,5,[4,6,[4,5,[5,[5,[6,100,[21]]]]]]]]; | |
| var result = (function getSum(arr) { | |
| var sum = arr.reduce(function(pre,cur,i,o){ | |
| if(typeof cur !== "number") { | |
| return pre + getSum(cur); | |
| } | |
| return pre+cur; | |
| }); |