`
robinqu
  • 浏览: 90249 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论
文章列表
来自: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 ...
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 ...
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 ...
函数是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. ...
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; ...
以下代码来自 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 ...

IE Conditional Tag

    博客分类:
  • css
<!--[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 " ...
来自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 ...
默认模式下,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 ...
来自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 ...
来自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. ...
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 ...
引用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, " ...
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为代表。 ...
Global site tag (gtag.js) - Google Analytics