- 浏览: 90249 次
- 性别:
- 来自: 武汉
最新评论
-
zhaohaolin:
哟,龙哥,你还搞C,好高大上的东西啊
xcode初探 -
robinqu:
又改了一些小错误~
[更新20100922]jQuery Location Select 插件- 地址联动、地理检测 -
robinqu:
kimm 写道这个功能不错,就是应用有点局限,内网就不好用了。 ...
[更新20100922]jQuery Location Select 插件- 地址联动、地理检测 -
robinqu:
更新了⋯⋯把代码重写了一次⋯⋯大家可以实现任何种类的联动,以及 ...
[更新20100922]jQuery Location Select 插件- 地址联动、地理检测 -
robinqu:
truth315 写道不好意思了,compu指的是getAre ...
JavaScript Prototype基础
文章列表
来自:http://www.macji.com/2009/01/18/javascript-this-keyword-tips/
this指向当前作用域的对象,如果找不到,往上一层找,直到window。
this 关键字很好用,很灵活,正因为很灵活,所以一不小心你就会掉进陷阱,所以你要注意以下几点:
1. 元素对象的this,始终指向该元素,如事件绑定。
2. 全局的this或者window的相关方法的this始终指向window对象,如setTimeout(function(){alert(this);}, 10)。
3. 自己创建的对象({}, new functio ...
- 2009-07-14 22:01
- 浏览 1190
- 评论(0)
Simulating Classes in JavaScript
目前,用js来模拟class是一件非常麻烦的事情,多少有点不优雅。
但是未来的JS肯定会支持class,那么这个语言就是基于class和Prototype的混合继承?到时候会不会越来越混乱呢?笑……
Instance Properties
实例属性
引用By default, any object property in JavaScript is an instance property.
对象的属性默认状态就是“实例属性”
Instance Methods
实例方法
引用In JavaScript, an insta ...
- 2009-07-14 16:39
- 浏览 1145
- 评论(0)
The prototype Property
引用prototype property that refers to a predefined prototype object
Prototype属性是指一个早已确定的原型对象
Classes, Constructors, and Prototypes
引用JavaScript does not support true classes the way that languages like Java, C++, and C# do.
JavaScript不支持真正的类继承,事实上是它是一个基于原型继承的,这和传统语言很不一样。
在Jav ...
- 2009-07-14 15:56
- 浏览 1514
- 评论(4)
函数是JS的引用数据类型
匿名函数
function() {
//Code here
}
给一个函数名
function foo() {
//code here
}
或者
var foo = function() {
//Code here
}
执行一个匿名函数
(function() {
//code here
})();
When a function is invoked with fewer arguments than are declared, the additional arguments have the undefined value. ...
- 2009-07-14 14:47
- 浏览 1145
- 评论(2)
Object、Array是JS的引用型基本属性
枚举Object中的属性:
function DisplayPropertyNames(obj) {
var names = "";
for(var name in obj) names += name + "\n";
alert(names);
}
检查对象中是否有某个属性并赋值:
方法1
// If o has a property named "x", then set it
if ("x" in o) o.x = 1;
...
- 2009-07-13 21:35
- 浏览 5031
- 评论(0)
以下代码来自 https://developer.mozilla.org/cn/%E4%BD%BF%E7%94%A8Javascript%E5%92%8CDOM_Interfaces%E6%9D%A5%E5%A4%84%E7%90%86HTML#page-tags
var mybody=document.getElementsByTagName("body").item(0);
mytable = document.createElement("TABLE");
mytablebody = document.createE ...
- 2009-07-13 20:51
- 浏览 1033
- 评论(0)
<!--[if IE 5.5000]>
You are using IE 5.5!
<![endif]-->
<!--[if IE 6]>
You are using IE 6!
<![endif]-->
Operator syntax Description
! The "not" operator.
lt The "less than" operator.
lte The "less than or equal to" operator.
gt The " ...
- 2009-07-11 20:49
- 浏览 797
- 评论(0)
来自JSDG:
引用The types can be divided into two groups: primitive types and reference types.
Numbers, boolean values, and the null and undefined types are primitive.
Objects, arrays, and functions are reference types.
A primitive type has a fixed size in memory.
Variables hold the actual ...
- 2009-07-06 15:31
- 浏览 803
- 评论(0)
默认模式下,flash内容总会在网页的最上层,这样的话像lightbox之类的东西就会很糟糕。Adobe官方的解决方案:http://kb2.adobe.com/cps/155/tn_15523.html
引用
Use the WMODE parameter to allow layering of Flash content with DHTML layers. The WMODE parameter can be 'window' (default), 'opaque', or 'transparent'. Using a WMODE value of 'opaque' or 'trans ...
- 2009-07-06 09:52
- 浏览 2645
- 评论(0)
来自http://mezzoblue.com/css/cribsheet/,一些CSS的开发技巧、规则
When in doubt, validate.
When debugging, you may save yourself a lot of headache by simply validating your code first. Improperly-formed XHTML/CSS will cause many a layout glitch.
Build and test your CSS in the most advanced browser available b ...
- 2009-07-04 17:57
- 浏览 853
- 评论(0)
来自Javascript Definitive Guide,了解<img>标签的属性
引用In addition to the onload event handler demonstrated in Example 22-4, the Image object supports two others. The onerror event handler is invoked when an error occurs during image loading, such as when the specified URL refers to corrupt image data. ...
- 2009-07-04 15:39
- 浏览 747
- 评论(0)
DOM Level 2 HTML: Node > Element > HTMLElement
这是一些DOM 2级属性,这些属性在Javascript Definitive Guide里面这样描述:
The properties supported by all HTML tags are listed here. Other properties, specific to certain kinds of HTML tags, are listed in the long table in the following Description section. HTMLElemen ...
- 2009-07-04 15:14
- 浏览 2362
- 评论(0)
引用overflow
Values:
visible | hidden | scroll | auto | inherit
Initial value:
visible
Applies to:
Block-level and replaced elements
Inherited:
No
Computed value:
As specified
If scroll is used, the panning mechanisms (e.g., scrollbars) should always be rendered. To quote the specification, " ...
- 2009-07-04 08:48
- 浏览 1329
- 评论(0)
Linux最早由Linus Benedict Torvalds在1991年开始编写。在这之前,Richard Stallman创建了Free Software Foundation(FSF)组织以及GNU项目,并不断的编写创建GNU程序(此类程序的许可方式均为GPL: General Public License)。在不断的有杰出的程序员和开发者加入到GNU组织中后,便造就了今天我们所看到的Linux,或称GNU/Linux。
Linux的发行版本可以大体分为两类,一类是商业公司维护的发行版本,一类是社区组织维护的发行版本,前者以著名的Redhat(RHEL)为代表,后者以Debian为代表。 ...
- 2009-07-03 23:22
- 浏览 3229
- 评论(0)