03 2013 档案
JavaScript中instanceof对于不同的构造器可能都返回true
摘要:JavaScript中instanceof对于不同的构造器可能都返回true我们知道 instanceof 运算符用来检查对象是否为某构造器的实例。下面列举它返回true的各种情景。1、对象obj是通过new Constructor创建的,那么 obj instanceof Constructor 为true?123456function Person(n, a) { this.name = n; this.age = a;}var p = new Person('John Backus', 82);console.log(p instanceof Person); // tr 阅读全文
posted @ 2013-03-06 21:26 tware_dsy 阅读(192) 评论(0) 推荐(0)
jqGrid -- 自定义格式化类型
摘要:<script>jQuery("#grid_id").jqGrid({... colModel: [ ... {name:'price', index:'price', width:60, align:"center", editable: true, formatter:currencyFmatter}, ... ]...});function currencyFmatter (cellvalue, options, rowObject){ // do something here return new_fo 阅读全文
posted @ 2013-03-04 10:30 tware_dsy 阅读(440) 评论(0) 推荐(0)