WebRoot/js/global.js

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/* $Id: global.js 15469 2008-12-19 06:34:44Z testyang $ */
Object.extend = function(destination, source)
{
  for (property in source) {
    destination[property] = source[property];
  }
  return destination;
}

Object.prototype.extend = function(object)
{
  return Object.extend.apply(this, [this, object]);
}

//封装getEelementById函数
function $()
{
  var elements = new Array();
  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }

  return elements;
}

//创建元素
function $ce(tagName)
{
    return document.createElement(tagName);
}

//定义类类型
var Class = {
  create : function()
  {
    return function()
    {
      this.initialize.apply(this, arguments);
    }
  }
}

//对象绑定
Function.prototype.bind = function(object) {
  var __method = this;
  return function()
  {
    __method.apply(object, arguments);
  }
}

if (!window.Event) {
  var Event = new Object();
后面还有 80 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。