js 获得 HTMLElement 函数 fGetObj

类别: Javascript, function
标签: js, func, HTMLElement, fGetObj
摘要: ..
正文:

  1.   function fGetObj(sId, sMsg)
  2.   {// shawl.qiu code : return HTMLElement
  3.    if(!sMsg) sMsg = "无法获得对象!";
  4.    var Obj = null;
  5.    
  6.    switch(typeof(sId)+"")
  7.    {
  8.     case "string":
  9.      Obj = document.getElementById(sId);
  10.      break;
  11.      
  12.     case "object": 
  13.      Obj = sId;
  14.      break;
  15.    }
  16.    
  17.    if(Obj==null)
  18.    {
  19.     throw new Error(sMsg);
  20.    }
  21.    
  22.    return Obj;
  23.   } // end function fGetObj(sId, sMsg) 
文章相关信息:
主题: js 获得 HTMLElement 函数 fGetObj
发表者: shawl.qiu
电子邮件: shawl.qiu@gmail.com
QQ: 908202921
MSN: btbtd@msn.com
Homepage: http://www.btbtd.org/
Blog: http://blog.csdn.net/btbtd/
发表日期: 2007-7-31 1:20:35
更新日期: 2007-7-31 1:20:35
来源引用: shawl.qiu CSharp DotNet 个人资料管理系统
引用本页: http://gi.2288.org/mod/code/display/Default.aspx?aid=506
关闭
Google
搜索WWW
搜索www.btbtd.org
搜索blog.csdn.net
Powered by shawl.qiu © 2008-2010 the shawl.qiu Javascript Kits
Copyright © 2008-2010 by shawl.qiu