09 2013 档案

摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ReflectionTest{ public class Employee { public string Name { get; set; } public int Age { get; set; } }}using System;using System.Collections.Generic;using System.Linq;using System.Text... 阅读全文
posted @ 2013-09-24 22:10 Master HaKu 阅读(288) 评论(0) 推荐(0) 编辑
摘要:bad code// BEFORE: 5 globals// Warning: antipattern// constructorsfunction Parent() {}function Child() {}// a variablevar some_var = 1;// some objectsvar module1 = {};module1.data = {a: 1, b: 2};var module2 = {};good code// AFTER: 1 global// global objectvar MYAPP = {};// constructorsMYAPP.Parent = 阅读全文
posted @ 2013-09-22 15:07 Master HaKu 阅读(510) 评论(0) 推荐(1) 编辑
摘要:This pattern is useful when your function has some initial preparatory work to do andit needs to do it only once.In such cases, the selfdefining function can update its own implementation.eg:var selfFunc = function () { console.log("First Initialization!"); selfFunc = function () { ... 阅读全文
posted @ 2013-09-22 13:10 Master HaKu 阅读(480) 评论(0) 推荐(0) 编辑
摘要:The caching options available in ASP.NET MVC applications don’t come from the ASP.NET MVC Framework, but from the core ASP.NET Framework.1. Request-Scoped CachingEvery ASP.NET request begins with the ASP.NET Framework creating a new instanceof the System.Web.HttpContext object to act as the central 阅读全文
posted @ 2013-09-21 17:36 Master HaKu 阅读(385) 评论(0) 推荐(0) 编辑
摘要:overriding the default options with user-supplied options and the jQuery extend() methodeg:$.fn.pulse = function (options) { // Merge passed options with defaults var opts = $.extend({}, $.fn.pulse.defaults, options); return this.each(function () { // Pulse for (var i = 0; i <... 阅读全文
posted @ 2013-09-21 15:19 Master HaKu 阅读(295) 评论(0) 推荐(0) 编辑
摘要:1. How do you write a plugin in jQuery?You can extend the existing jQuery object by writing either methods or functions.1) Writing a custom jQuery methodjQuery methods are defined by extending the jQuery.fn object with your method name.$.fn.extend({ //Only Test MasterTest: { alertTest: ... 阅读全文
posted @ 2013-09-21 15:01 Master HaKu 阅读(272) 评论(0) 推荐(0) 编辑
摘要:1. Base2. Layout3. Module4. State5. Theme1) Base rulesBase rules are the defaults.eg:html, body, form { margin: 0; padding: 0; }input[type=text] { border: 1px solid #999; }a { color: #039; }a:hover { color: #03C; }2) Layout rulesdivide the page into sections. Layouts hold one ormore modules together 阅读全文
posted @ 2013-09-21 11:36 Master HaKu 阅读(320) 评论(0) 推荐(0) 编辑
摘要:1. 动态添加对象的属性和方法// start with an empty objectvar dog = {};// add one property dog.name = "Benji";// now add a method dog.getName = function () { return dog.name; };2. 一次性创建对象var dog = { name: "Benji", getName: function () { return this.name; }};3. 使用内建的构造函数// one way -- using a li 阅读全文
posted @ 2013-09-19 16:48 Master HaKu 阅读(238) 评论(0) 推荐(0) 编辑
摘要:jQuery UI Widget - Default functionality color me color me color me Toggle disabled option Go black 运行结果: 阅读全文
posted @ 2013-09-19 08:36 Master HaKu 阅读(1450) 评论(0) 推荐(0) 编辑
摘要:http://www.dotnetperls.com/datetime-format 阅读全文
posted @ 2013-09-11 14:52 Master HaKu 阅读(283) 评论(0) 推荐(0) 编辑
摘要:JavaScript is a class-less language, however classes can be simulated using functions.eg:// A car 'class'function Car(model) { this.model = model; this.color = 'silver'; this.year = '2012'; this.getInfo = function () { return this.model + ' ' + this.year; }}We can the 阅读全文
posted @ 2013-09-01 16:34 Master HaKu 阅读(368) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示