function $(id)
{
document.getElementById(id)
}

解决方案 »

  1.   

    $("item_code")如果我没有看错的话这是一个错误的写法。$()
    通常是jquery的写法,jQuery(expression,[context])
    这个函数接收一个包含 CSS 选择器的字符串,然后用这个字符串去匹配一组元素。 
    jQuery 的核心功能都是通过这个函数实现的。 jQuery中的一切都构建于这个函数之上,或者说都是在以某种方式使用这个函数。这个函数最基本的用法就是向它传递一个表达式(通常由 CSS 选择器组成),然后根据这个表达式来查找所有匹配的元素。默认情况下, 如果没有指定context参数,$()将在当前的 HTML 文档中查找 DOM 元素;如果指定了 context 参数,如一个 DOM 元素集或 jQuery 对象,那就会在这个 context 中查找。参考 Selectors 获取更多用于 expression 参数的 CSS 语法的信息。
    --------------------------------------------------------------------------------This function accepts a string containing a CSS selector which is then used to match a set of elements. 
    The core functionality of jQuery centers around this function. Everything in jQuery is based upon this, or uses this in some way. The most basic use of this function is to pass in an expression (usually consisting of CSS), which then finds all matching elements. By default, if no context is specified, $() looks for DOM elements within the context of the current HTML document. If you do specify a context, such as a DOM element or jQuery object, the expression will be matched against the contents of that context. See Selectors for the allowed CSS syntax for expressions.返回值
    jQuery参数
    expression (String) : 用来查找的字符串context (Element, jQuery) : (可选) 作为待查找的 DOM 元素集、文档或 jQuery 对象。
      

  2.   

    他用的dwr框架!$()这个函数是dwr的函数
      

  3.   


    function $(id) 

      return typeof(id) =='string' ? document.getElementById(id):id; 
      

  4.   

    $ 是在 Prototype 框架中引入的