javascript
文章平均质量分 69
tanxiuguang
这个作者很懒,什么都没留下…
展开
-
自己写的一个螺旋矩阵的算法
[code="javascript"] function Direction(x, y) { this.x = x; this.y = y; } function generateMatrix(n) { var dim = Math.ceil(Math.sqrt(n)); //var dim = n; var cen = Math.ceil(di...2009-09-28 14:13:21 · 156 阅读 · 0 评论 -
javascript summary11-12
The arguments[] array is useful in a number of ways. The following example shows how you can use it to check that a function is invoked with the correct number of arguments, since JavaScript doesn't d...原创 2008-11-12 10:30:00 · 72 阅读 · 0 评论 -
javascript summary11-12(2)
[b]Enumerating Properties[/b]The for/in loop discussed in Chapter 6 provides a way to loop through, or enumerate, the properties of an object. This can be useful when debugging scripts or when worki...原创 2008-11-12 16:18:09 · 151 阅读 · 0 评论 -
javascript summary11-13
[b]Enhanced typeof function[/b][code="javascript"]o.toString() // May invoke a customized toString( ) method for the object [/code]Instead, we have to refer explicitly to the default toString( )...原创 2008-11-13 10:38:36 · 84 阅读 · 0 评论 -
Javascript Regular Expressions
10.1.2 Character ClassesIndividual literal characters can be combined into character classes by placing them within square brackets. A character class matches any one character that is containe...原创 2008-11-13 16:36:26 · 144 阅读 · 0 评论 -
javascript converting strings to numbers
To allow more flexible conversions, you can use parseInt( ) and parseFloat( ). These functions convert and return any number [color=red]at the beginning of a string[/color], ignoring any trailing non-...原创 2008-11-13 17:20:29 · 92 阅读 · 0 评论 -
小图片合并的作用
转载 原帖地址 http://yukaizhao.iteye.com/blog/290538 在对大访问量网站进行性能优化时,其中有一点是尽量减少http连接数,道理很明了,减少了单个PV的http连接数,肯定可以增加单台服务器的用户负载数。 减少Http连接数的具体方法是减少没必要的iframe使用,合并js文件,css文件,和一种常见的方法,合并Css小背景图,合并Css...原创 2009-02-13 11:23:05 · 252 阅读 · 0 评论 -
getComputedStyle function
[b]Getting an element's style[/b]It is occasionally useful to get a specific element's actual style, after all CSS rules have been applied. You mightnaively assume that an element's style property...原创 2009-02-20 16:42:08 · 94 阅读 · 0 评论 -
document.evaluate
使用 Greasemonkey 时会遇到的功能最为强大的一个工具就是 evaluate 函数。通过使用XPath这种查询语言,它可以用来寻找页面中的元素,属性和文本。举个例子来说,如果您想获得某个页面上的全部链接。您也许会想到使用document.getElementsByTagName('a');但是如果您还要继续检查是否每个链接都具有href属性,因为还可以用来作为锚名称使用,这时...原创 2009-02-20 17:27:53 · 102 阅读 · 0 评论