2014年6月25日

DOMContentLoaded vs load

摘要: DOMContentLoadedThe DOMContentLoaded event is fired when the document has been completely loaded and parsed, without waiting for stylesheets, images, ... 阅读全文

posted @ 2014-06-25 10:44 kai08 阅读(317) 评论(0) 推荐(0) 编辑

2014年6月18日

compatMode与documentMode

摘要: compatMode //判断是标准模式还是怪异模式渲染页面,如下代码:if (document.compatMode == "CSS1Compat") { alert("Standards mode");} else { //BackCompat alert("Quirks m... 阅读全文

posted @ 2014-06-18 11:35 kai08 阅读(169) 评论(0) 推荐(0) 编辑

跨浏览器窗口大小(全兼容)

摘要: //只列举width的情况,height的情况类似var pageWidth = window.innerWidth;if(typeof pageWidth != 'number'){ if(document.compatMode == 'CSS1Compat'){ pageWidth = doc... 阅读全文

posted @ 2014-06-18 11:07 kai08 阅读(186) 评论(0) 推荐(0) 编辑

2014年6月17日

javascript cloneNode与event事件

摘要: 用法:var newNode = oldNode.cloneNode(deep);//deep 深度,布尔值,如果为true,则克隆oldNode 这个及其子节点,否则只可能这个节点本身高级程序设计第三版有:其中ie的bug,说得非常模糊。其实是:就是说,克隆的过程中,如果克隆的是内联事件,则可以复... 阅读全文

posted @ 2014-06-17 16:19 kai08 阅读(668) 评论(0) 推荐(0) 编辑

2014年6月13日

ie10的input框新特性的去除

摘要: ie10的input加了两个特性:对应的,可以用css方式去除:input::-ms-clear{display:none;}input::-ms-reveal{display:none;} 阅读全文

posted @ 2014-06-13 11:08 kai08 阅读(217) 评论(0) 推荐(0) 编辑

debug一下document.all

摘要: document.all可以判断浏览器是否是IE if(document.all){ alert("is IE!"); }很多地方甚至高级程序设计第三版,都说这样可以检测ie其实chrome也有document.all,备注一下。 阅读全文

posted @ 2014-06-13 10:37 kai08 阅读(131) 评论(0) 推荐(0) 编辑

2013年6月17日

javascript Literal

摘要: 一个字面量就是在源代码中表示某个固定值的符号.javascript Literal(字面量、直接量),标准文档包含:ArrayLiteralBooleanLiteralDecimalIntegerLiteralDecimalLiteralHexIntegerLiteralJSONBooleanLiteralJSONNullLiteralNullLiteralNumericLiteralObjectLiteralOctalIntegerLiteralRegularExpressionLiteralStrDecimalLiteralStringLiteralStringNumericLiteral 阅读全文

posted @ 2013-06-17 17:35 kai08 阅读(164) 评论(0) 推荐(0) 编辑

2013年4月17日

关于传统事件模型和标准事件模型的几点思考

摘要: 1,传统事件模型例:onclick可以被覆盖:document.body.onclick = function(){console.log('num1');}document.body.onclick = function(){console.log('num2');}结果:num2销毁方式:doc... 阅读全文

posted @ 2013-04-17 11:32 kai08 阅读(181) 评论(0) 推荐(0) 编辑

Reference, List, and Completion of javascript

摘要: “A value is an entity that takes on one of nine types. There are nine types (Undefined, Null, Boolean, String, Number, Object, Reference, List, and Completion).”1,Reference The internal Reference type is not a language data type. The Reference type is used to explain the behaviour of such operator.. 阅读全文

posted @ 2013-04-17 11:16 kai08 阅读(155) 评论(0) 推荐(0) 编辑

导航