11 2010 档案

摘要:最近在研究js,疑惑也比较多。主要是被原型这个东西给弄迷糊了。疑惑出自于:function foo {  this.name = 'foo';}alert(foo.prototype === Function.prototype ); //false。 当时一直没想明白为啥foo的原型不是Function.prototype。下面例子让我想当然的认为o.prototype === Function... 阅读全文
posted @ 2010-11-17 17:49 Stephen.Huang 阅读(2166) 评论(4) 推荐(2) 编辑
摘要:块级作用域:大多数使用c语言语法的语言都有块级作用域,而JavaScript没有块级作用域。如代码块if (true) { inti = 100;}print(i); //错误,变量i没有声明如上面例子所示,代码块外的函数是无法访问i变量的。但在javaScript里,情况则完全不同。if (true) { var i = 100;}alert(i); //弹出框并显示100很多现代语言都推荐尽可... 阅读全文
posted @ 2010-11-16 21:30 Stephen.Huang 阅读(381) 评论(0) 推荐(0) 编辑
摘要:JavaScript的假值列表如下, 值 类型 0 Number NaN (非数字) Number '' (空字符串) String false Boolean null Object undefined Undefined 以上的值作为判断条件,都将为假值,如:if(undefined){ alert('undefined');//这行代码不会执行}while(null){ alert('n... 阅读全文
posted @ 2010-11-16 19:48 Stephen.Huang 阅读(254) 评论(0) 推荐(0) 编辑
摘要:1.html文件第一行要放Document Type, 以防浏览器使用Quirks模式来解析页面[代码]2. html一定要有head和body。head里面一定要有meta(指的是指定此html编码的meta,如meta http-equiv=”Content-Type” content=”text/html; charset=utf”,且一定要作为head的第一个子元素,保证浏览器成功解析title的内容)和title。3.p里不能放block element,blockquote里一定要放block element。4.body里只能放bloc 阅读全文
posted @ 2010-11-12 11:53 Stephen.Huang 阅读(525) 评论(3) 推荐(0) 编辑

点击右上角即可分享
微信分享提示