
JavaScript
sprite1225
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
image src 属性为空导致的问题
img标签为空有两种情况,一种是基本的HTML:另一种是在JavaScript中:var img = new Image();img.src = ""; 这两种情况都会导致同样的效果:IE会自动请求当前页面所在的路径,例如页面地址为http://www.example.com/dir/mypage.htm,那么IE将会自动请求一次http://www.e原创 2009-12-16 11:32:00 · 2058 阅读 · 0 评论 -
JavaScript性能优化之循环操作
JavaScript中有四种不同类型的循环,for循环、do-while循环和while循环。(第四种类型为for-in循环,用于迭代对象的属性,本文不予讨论。)代码如下:var values = [1, 2, 3, 4, 5];//for 循环for(var i=0; iprocess(values[i]);}//do-while 循环var j=0;do{process(values[j++]原创 2009-12-16 11:57:00 · 390 阅读 · 0 评论 -
JavaScript “Associative Arrays” Considered Harmful
The ProblemTry the following code on an empty page, one without any JavaScript libraries added: Try the following code on an empty page, one without any JavaScript libraries added: var associati转载 2009-12-18 09:34:00 · 406 阅读 · 0 评论 -
Parsing URLs with the DOM
This short function returns an object containing all possible information you would want to retrieve from a URL:parseURL// This function creates a new anchor element and uses location// prope转载 2009-12-18 09:39:00 · 304 阅读 · 0 评论 -
7 JavaScript Differences Between Firefox & IE
Although the days of long and tedious code branches to target specific browsers in JavaScript are over, once in a while its still necessary to do some simple code branching and object detection to en转载 2009-12-18 09:41:00 · 355 阅读 · 0 评论