2011年7月27日

乱写

摘要: functionshit(name,value){returntypeofname=='string'?{name:value}:name;};alert(shit('name','argb').name);alert(shit(['fuck','you'])); 阅读全文

posted @ 2011-07-27 16:47 argb 阅读(177) 评论(0) 推荐(0) 编辑

一个js倒计时器(countdown timer)

摘要: 项目中用到的一个倒计时器,直接上代码:1//JavaScriptDocument23/*4*author:argb5*contact:argb@live.cn6*7*Copyright©2011,Allrightsreserved8*/9/*10*e.g11*endDateParam:{year:2011,month:12,day:5}12*13*/14functionbind(fn,obj){1516if(typeofobj!=='object'){17throw'objisnotanobject';18}19varargs=Array.protot 阅读全文

posted @ 2011-07-27 12:54 argb 阅读(6642) 评论(0) 推荐(0) 编辑

2011年7月26日

几条值得记下的语录

摘要: 1、Dr. Johnson‘s words come to mind: “the part that is good is not original, and the part that is original is not good.”2、You probably don’t even know what skills you need, so don’t worry about it. Start with what you already know. --出处:http://37signals.com/svn/posts/2538-the-first-step-is-to-start 阅读全文

posted @ 2011-07-26 14:14 argb 阅读(179) 评论(0) 推荐(0) 编辑

2011年7月24日

javascipt的类型

摘要: js中的类型很让人纠结,没有一个标准,严格的判别方法,根据我对相关资料的理解,js类型可分为两大部分,一是基本类型,一是复合类型基本类型包括:undefined null number string boolean五种,但是null比较特殊,typeof null 得到的结果是'object'复合类型:只有一个object,但是object又可分为两类, 可执行的(function),不可执行的(object),如果按其内部属性[[class]]来分的话又可分为很多种类。关于typeof请参见另一篇文章typeof 操作符参考:ecma-262 edition5.1 ----- 阅读全文

posted @ 2011-07-24 15:10 argb 阅读(248) 评论(0) 推荐(0) 编辑

typeof 操作符

摘要: typeof操作符也是一元操作符其产生式(production)为:UnaryExpression:typeof UnaryExpression其求值过程如下:1、先对右侧的一元表达式求值,将结果赋给val2、 如果Type(val)是引用(Referecne),那么 a、如果IsUnresolvableReference(val) 是true ,返回"undefinded" b、把GetValue(val)的结果赋给val3、返回一个由Type(val)决定的字符串,相见下表基本规律为:如果是typeof的目标是基本类型(undefinded,number,string, 阅读全文

posted @ 2011-07-24 14:40 argb 阅读(324) 评论(0) 推荐(0) 编辑

void操作符

摘要: void操作符也许常常被用到,但是可能大家对其了解不多。void操作符是一个一元运算符,求值结果总是undefined,但是其求值过程可能会产生副作用:E.gvartemp=1;varb=void(temp=2);alert(temp)//result:2alert(b);//result:undefined参考:ecma 262 edition 5.1----11.4.2 The void Operator 阅读全文

posted @ 2011-07-24 14:17 argb 阅读(204) 评论(0) 推荐(0) 编辑

函数表达式

摘要: ecma 262 (5.1 Edition / June 2011)中关于函数的定义:SyntaxFunctionDeclaration :function Identifier ( FormalParameterListopt ) { FunctionBody }FunctionExpression :function Identifieropt( FormalParameterListopt) { FunctionBody }FormalParameterList :Identifier FormalParameterList , IdentifierFunctionBody :Sour. 阅读全文

posted @ 2011-07-24 13:45 argb 阅读(464) 评论(0) 推荐(0) 编辑

2011年7月23日

the difference between grammar and syntax

摘要: Grammar is the study of rules governing the use of language. The set of rules governing a particular language is the grammar of that language; thus, each language can be said to have its own distinct grammar. Grammar is part of the general study of language called linguistics. Grammar is a way of th 阅读全文

posted @ 2011-07-23 10:50 argb 阅读(1190) 评论(0) 推荐(0) 编辑

2011年7月8日

What's JSON

摘要: 虽然json已成为一个大家熟知的词,但是可能很多人仍不清楚其真正的概念。So,what's json?JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 阅读全文

posted @ 2011-07-08 13:31 argb 阅读(375) 评论(0) 推荐(0) 编辑

2011年7月6日

ECMA262(v5)点滴(二)

摘要: 10.4 Establishing an Execution Context(执行环境建立 p57)Evaluation of global code or code using the eval function (15.1.2.1) establishes and enters a new execution context. Every invocation of an ECMAScript code function (13.2.1) also establishes and enters a new execution context, even if a function is c 阅读全文

posted @ 2011-07-06 16:05 argb 阅读(199) 评论(0) 推荐(0) 编辑

导航