Hi Mike, Fantastic!!! This is very very good!!! I'll publish this CMS at sourceforge soon, and if you agree your name will be appear in special thanks. Ok? This is the most important contribution form my project. Thank you very much!
Dirceu Barquette 2008/12/24 Michael Geary <m...@mg.to> > I must have been getting forgetful when I posted that suggestion. As I > mentioned, .toSource() is not available in all browsers, so it wouldn't be > suitable for your CMS feature that you want to make available to your site's > visitors. > > But .toString() *is* available in all browsers, and it gives you the source > code for a function. So you can just use that instead. > > Here's a test case: > > http://mg.to/test/jquery-methods.html > > That page lists all of the jQuery and jQuery() methods in alphabetical > order. > > The code is: > > jQuery(function() { > dump( 'jQuery', jQuery ); > dump( 'jQuery()', jQuery.prototype ); > function dump( title, object ) { > var list = []; > for( name in object ) { > var fn = object[name]; > if( jQuery.isFunction(fn) ) { > list.push( '<div>' + title + '.' + name + > fn.toString().match(/(\([^)]*\))/)[1] + '</div>' ); > } > } > $('#list').append( '<h3>' + title + ' methods:</h3>' + > list.sort().join('') ); > } > }); > > -Mike > > ------------------------------ > *From:* Dirceu Barquette > WOW!!! > > .toSource is amazing!!! thank you again!!!! > > Dirceu Barquette > > 2008/12/23 Michael Geary <m...@mg.to> > >> So you have a list of the methods of an object and you want to find out >> what the parameters to each method are, is that right? >> >> There are three ways you can do this: >> >> 1) In Firefox, you can call the .toSource() method of an object (including >> a function) to see its source code. For example, try this in the Firebug >> console: >> >> (function foo(a,b,c){}).toSource() >> >> .toSource() isn't available in all browsers. >> >> 2) Of course, if you're doing that, you may as well just go back to the >> original source code, which will also have some comments: >> >> http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js >> >> For most functions, you can search for functionname: to find it. There are >> a few exceptions such as the height() and width() methods - you'll find >> those with a search for Height or Width. >> >> 3) There is the documentation too: >> >> http://docs.jquery.com/Main_Page >> >> -Mike >> >