The evaluate function takes a total of five arguments: xpathExpression: A string containing an xpath expression to be evaluated contextNode: A node in the document against which the Xpath expression should be evaluated namespaceResolver: A function that takes a string containing a namespace prefix from the xpathExpression and returns a string containing the URI to which that prefix corresponds. This enables conversion between the prefixes used in the XPath expressions and the (possibly different) prefixes used in the document resultType: A numeric constant indicating the type of result that is returned. These constants are avaliable in the global XPathResult object and are defined in the relevaant section of the XPath Spec. For most purposes it"s OK to pass in XPathResult.ANY_TYPE which will cause the results of the Xpath expression to be returned as the most natural type result:An existing XPathResult to use for the results. Passing null causes a new XPathResult to be created. 其中__proto__这个在FF下可以取得对象的prototype对象,即对象的原型。这也是javascript继承机制的基础,基于原型的继承,不像通常的C++,JAVA,C#语言的基于类的继承。还有一种metaclass的继承方式,在ruby和python中常有应用。 其中ScriptFragment定义网页中引用脚本的正则表达式 JSONFilter:还是引用prototype原文的解释更清楚他的用法—— 复制代码 代码如下: /*String#evalJSON internally calls String#unfilterJSON and automatically removes optional security comment delimiters (defined in Prototype.JSONFilter).*/
/*You should always set security comment delimiters (/*-secure-
...*/) around sensitive JSON or JavaScript data to prevent Hijacking. (See this PDF document for more details.)*/