[jQuery] Re: How to test if plugin X is loaded ?

2007-08-15 Thread Bernd Matzner
You could also use a try/catch clause try { $('#id').tableSorter(); } catch(err) { // do something else or nothing } Bernd

[jQuery] Re: How to test if plugin X is loaded ?

2007-08-15 Thread Erik Beeson
Because I think it would be much cleaner to just load the plugins that you want in the first place... --Erik On 8/15/07, xavier <[EMAIL PROTECTED]> wrote: > > > Thanks, didn't search the doc at the right place (was looking into > core, that's under ajax). > > Why would you question if I really w

[jQuery] Re: How to test if plugin X is loaded ?

2007-08-15 Thread xavier
Thanks, didn't search the doc at the right place (was looking into core, that's under ajax). Why would you question if I really want to do that ? What would be the reason/risk of doing it ? X+ On Aug 15, 1:09 am, "Erik Beeson" <[EMAIL PROTECTED]> wrote: > I question whether or not you really wa

[jQuery] Re: How to test if plugin X is loaded ?

2007-08-14 Thread Erik Beeson
I question whether or not you really want to be doing that... But here's both questions in one go: if(!$.isFunction($.fn['pluginName'])) { $.getScript('/path/to/plugin', function() { alert('Plugin ready'); }); } else { alert('Plugin ready'); } That assumes the plugin is on the same doma

[jQuery] Re: How to test if plugin X is loaded ?

2007-08-14 Thread Benjamin Sterling
Xavier, For question #1: if(typeof $.fn.tableSorter == 'function') question #2: yes, you just need to know the path to the file and do a document.write(' wrote: > > > Hello, > > I'd like to be able to test if a specific plug in is loaded before > calling some of its properties (to avoid throwing