AjaxPro的HttpHandler会在页面注册至少4个js文件,这4个文件构成AjaxPro的客户端框架,这篇文章将介绍这些js文件的功能和使用.

prototype.js

这个js文件对Javascript原生对象进行了扩展,这个扩展很有Prototype的风格.使用方法和Prototype一样,可以参见Prototype API

对Object扩展

这是一段很经典的代码,很多人见过,将Object的原型进行扩展,在面向对象的javascript中很有用处
AjaxPro新发现(三):客户端框架Object.extend(dest, source, replace)

Function 扩展

  • apply(o, a)
  • Function.bind(o)

Array扩展

  • push(o)
  • addRange(items)
  • clear()
  • shift()

String扩展

  • trimLeft()
  • trimRight()
  • trim()
  • endsWith(s)
  • startsWith(s)
  • split(c)
  • format(str):静态方法 String.format("This is a {0}",str);
  • isNullOrEmpty():静态方法 String.isNullOrEmpty(""); //returns true

Event实用方法

  • addEvent(o, evType, f, capture)
  • removeEvent(o, evType, f, capture)

Core.js

扩展Function方法:getArguments()返回参数数组

浏览器检测

  • MS.Browser.isIE
  • MS.Browser.isFirefox
  • MS.Browser.isOpera

上述方法是AjaxPro的客户端的实用方法,说出来就不需要再定义类似的方法.Core.js还封装了Ajax.Request类实现异步通信

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-03
  • 2022-12-23
  • 2021-10-17
  • 2021-08-22
  • 2021-04-20
  • 2021-09-08
猜你喜欢
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案