- /* Prototype JavaScript framework, version 1.5.1.1
- * (c) 2005-2007 Sam Stephenson
- *
- * Prototype is freely distributable under the terms of an MIT-style license.
- * For details, see the Prototype web site: http://www.prototypejs.org/
- *
- /*--------------------------------------------------------------------------*/
- /*创建一个prototype对象,包含当前Prototype的版本以及当前浏览器信息*/
- /*var prototype{}来创建对象,version:‘1.5.1.1’对象的属性创建*/
- var Prototype = {
- Version: '1.5.1.1',
- /*这个方法用的很巧,将一个NaN或者undefined对象通过两次!运算,得到false*/
- Browser: {
- IE: !!(window.attachEvent && !window.opera),
- Opera: !!window.opera,
- WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
- Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1
- },
-
- /*IE6.0和Firefox2.0都不支持XPath*/
- /*IE6.0不支持ElementExtensions,Firefox则支持*/
- BrowserFeatures: {
- XPath: !!document.evaluate,
- ElementExtensions: !!window.HTMLElement,
- SpecificElementExtensions:
- (document.createElement('div').__proto__ !==
- document.createElement('form').__proto__)
- },
- /*正则,用来抽取出页面上用<script ...> ... </script>标记的代码段*/
- ScriptFragment: '<script[^>]*>([//S//s]*?)<//script>',
- JSONFilter: /^///*-secure-([/s/S]*)/*///s*$/,
- /*定义一个空函数*/
- emptyFunction: function() { },
- /*暂时不明白定义这个函数的用意*/
- K: function(x) { return x }
- }