Adnan
Adnan

Reputation: 1409

Find all jQuery scope stuff

As we all know jQuery scope contains the namespace for all jQuery plugins. Is there any way to list all jQuery loaded stuff in jQuery scope? The best example of my question is phpinfo() in PHP, it lists all loaded stuff of PHP.

Upvotes: 0

Views: 63

Answers (2)

user3941924
user3941924

Reputation:

$.each(obj, function(key, value) {
  console.log(key + ": " + value);
});

Upvotes: 1

Mulan
Mulan

Reputation: 135406

This should be okay

for (var plugin in $.fn) {
  if ($.fn.hasOwnProperty(plugin)) {
    console.log(plugin);
  }
}

If es5 is supported, you can use

var plugins = Object.keys($.fn).sort().join(", ");
console.log(plugins);

I think this produces the nicest output

Upvotes: 1

Related Questions