Recently I found myself switching between Emacs and browser to refer the jQuery documentation. So I looked around and found XML dump of the jQuery documentation. Now I have the data and just have to figure out a way to display it inside emacs. Parsing the XML file every time to look-up a method documentation will be very slow. So I wrote a converter which will parse the XML dump and spit out elisp code. The generated elisp code will look as follows.

(push "$.grep" jquery-doc-methods)
(puthash
 "$.grep"
 (quote (("name" . "$.grep")
         ("signatures"
          "$.grep"
          (("array" "The array to search through." nil nil)
           ("function(elementOfArray, index)" "..." nil nil)))
         ("longdesc"
          (text . "The $.grep() method ...")
          (js . "$.grep( [0,1,2], function(n,i){
				             return n > 0;
                                        },true);"))))
 jquery-doc-hash)

Now all I have to do is configure auto complete to use this data and write some code to display the documentation in a buffer.