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 showInfo(Obj) | |
| { | |
| for (var k in Obj) { | |
| if (Obj.hasOwnProperty(k)) { | |
| console.log("Obj." + k + ":" + Obj[k]); | |
| } | |
| } | |
| } |
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
| //how to use it ? | |
| //1. You need jQuery | |
| //2. finish the code about GetData GetTemplate GenSomething | |
| //3. Call the Run() like the following | |
| var obj = new myObject(); | |
| obj.Run(); | |
| // | |
| function myObject() { | |
| var template, | |
| data = { |
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
| 1.web.config & Settings.cs 化 | |
| 2.attribute產生log & web log | |
| 3.javascript minify nonchache & json parse |
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 lang="en" xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title></title> | |
| <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
| <script type="text/javascript"> | |
| //#region | |
| var MyModule = {}; |
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 runat="server"> | |
| <title></title> | |
| <style> | |
| input:focus::-webkit-input-placeholder { color:transparent; } | |
| input:focus:-ms-input-placeholder { color:transparent; } | |
| input:focus::-moz-placeholder { color:transparent; } /* FF 4-18 */ | |
| input:focus:-moz-placeholder { color:transparent; } /* FF 19+ */ | |
| </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 getQueryValue(name) { | |
| name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
| var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
| results = regex.exec(location.search); | |
| return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
| } |
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
| //學習沙盒模式(Sandbox pattern)的範例 | |
| //順便整合一些之前常用的code,ex: 取亂數、取cookie等… | |
| Marsen.modules = {} ; | |
| Marsen.modules.web = function(box){ | |
| box.getQueryValue = function (name) { | |
| name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
| var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
| results = regex.exec(location.search); | |
| return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
| };//query string 取值 |
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
| //擴充Date基本方法 | |
| Date.prototype.format = function (fmt) { | |
| var opt = { | |
| "M+": this.getMonth() + 1, //月 | |
| "d+": this.getDate(), //日 | |
| "h+": this.getHours(), //時 | |
| "m+": this.getMinutes(), //分 | |
| "s+": this.getSeconds(), //秒 | |
| "q+": Math.floor((this.getMonth() + 3) / 3), //季 | |
| "S": this.getMilliseconds() //毫秒 |
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
| //CSharp | |
| new Date((cSharp.Ticks/10000) - 62135625600000), |
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
| $(document).ready(function(){ | |
| $("#content").hide(); | |
| $("#content").fadeIn(2000); | |
| $(".nav").hide(); | |
| $(window).scroll(function(){ | |
| if($(document).scrollTop()<7){ |