Object is used by Prototype as a namespace; that is, it just keeps a few new methods together, which are intended for namespaced access (i.e. starting with “Object.”). 上面说的namespace个人理解就相当于C#中的静态类,提供工具函数的意思,和C#中的namespace应该不是一个概念。因为C#中的命名空间后面不会直接跟方法,
$ $$ $A $F $H $R $w Try.these document.getElementsByClassName $方法——被成为瑞士军刀(Swiss Army knife) If provided with a string, returns the element in the document with matching ID; otherwise returns the passed element. Takes in an arbitrary number of argume
$w方法 Splits a string into an Array, treating all whitespace as delimiters. Equivalent to Ruby’s %w{foo bar} or Perl’s qw(foo bar). 代码如下:function $w(string) { if (!Object.isString(string)) return []; string = string.strip(); return string ? string.spl
$A方法: Accepts an array-like collection (anything with numeric indices) and returns its equivalent as an actual Array object. This method is a convenience alias of Array.from, but is the preferred way of casting to an Array. 代码如下:function $A(iterable