Practicing Modular JavaScript - Object Literal Pattern
credits to the owner.
A Pen by Jeferson York B. Mari on CodePen.
Practicing Modular JavaScript - Object Literal Pattern
credits to the owner.
A Pen by Jeferson York B. Mari on CodePen.
| // Local Storage | |
| var rows = JSON.parse(localStorage.getItem('names') || []); | |
| rows.push('names'); | |
| localStorage.setItem('names', JSON.stringify(rows)); |
| // encode(decode) html text into html entity | |
| var decodeHtmlEntity = function(str) { | |
| return str.replace(/&#(\d+);/g, function(match, dec) { | |
| return String.fromCharCode(dec); | |
| }); | |
| }; | |
| var encodeHtmlEntity = function(str) { | |
| var buf = []; | |
| for (var i=str.length-1;i>=0;i--) { |
| <div class="box-1"></div> | |
| <div class="box-2"></div> |