Kook $ v1.0.2

  1. /**
  2. *@function 获得Html Element
  3. *@param id Html Element`s ID
  4. *@return Html Element Object
  5. *@author Kyle
  6. *@version 1.0.2
  7. *@time 2008-12-14
  8. *@update note 使用HTMLElement.prototype提高非ie下效率
  9. *@advisor: hackwaly 使用HTMLElement.prototype
  10. *@next document.getElementById速度,if(isNotIE)指令
  11. */
  12.  isNotIE=!document.all;//不是ie
  13. function $(id){
  14.     var _element=document.getElementById(id);
  15.     if(!isNotIE)_element.$=$;//如果是IE
  16.     return _element;
  17. }
  18. if(isNotIE){//if unMSIE
  19.     HTMLElement.prototype.$=$;
  20. }

你可能感兴趣的:(Kook $ v1.0.2)