冠军

导航

2010年4月24日

jQuery1.3.2 源码学习-8 index 函数

摘要: // Determine the position of an element within // the matched set of elements160 index: function( elem ) { // Locate the position of the desired element return jQuery.inArray( // If it receives a jQue... 阅读全文

posted @ 2010-04-24 21:13 冠军 阅读(1106) 评论(0) 推荐(0) 编辑

Javascript 中的相等与不等

摘要: 在 javascript 中,可以使用 == 来比较两个数据是否相等,如果两个数据的类型不同,那么,将在进行转换后进行比较,转换的规则如下:l 如果其中一个操作数的类型为 Boolean ,那么,首先将它转换为数字类型,false 转换为 0, true 将转换为 1。l 如果其中一个操作数的类型是字符串,另外一个为数字类型,那么,将字符串转换为数字进行比较。l 如果其中一个操作数的类型是字符串,... 阅读全文

posted @ 2010-04-24 20:09 冠军 阅读(18629) 评论(4) 推荐(4) 编辑

Javascript 中的 && 和 ||

摘要: 普通情况下的 && 和 || 比较简单,这里不进行讨论。准备两个对象用于下面的讨论。var alice = { name: "alice", toString: function () { return this.name; }}var smith = { name: "smith", toString: function () { return this.name; }}在 ja... 阅读全文

posted @ 2010-04-24 19:58 冠军 阅读(5800) 评论(7) 推荐(4) 编辑