code optimisation querry

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shehyamt
    New Member
    • Feb 2007
    • 1

    code optimisation querry

    Hi
    I m using ajax for my work so the length of the js is increasing beyond a certain limit. Can any one help me for code optimization. The first level i need is to replace document.getEle mentById(), for about 30 fields to a optimized code.
    Shaheer
  • dorinbogdan
    Recognized Expert Contributor
    • Feb 2007
    • 839

    #2
    You can create and use a new function, like:
    Code:
    function GetEltById(id){
    return document.getElementById(id);
    }

    Comment

    • dmjpro
      Top Contributor
      • Jan 2007
      • 2476

      #3
      i don't understand ur answer .........

      hellooooo shehyamt ....

      u can split the code into several js files ...

      and add in ur html page ...

      <script language = javascript src = uri_name1></script>
      <script language = javascript src = uri_name2></script>
      ----------
      -------------
      <script language = javascript src = uri_namen></script>

      isn't it ur answer ....

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Originally posted by shehyamt
        Hi
        I m using ajax for my work so the length of the js is increasing beyond a certain limit. Can any one help me for code optimization. The first level i need is to replace document.getEle mentById(), for about 30 fields to a optimized code.
        Shaheer
        You can use some compression techniques as described here.

        Comment

        Working...