An open API service indexing awesome lists of open source software.

https://github.com/mjc-gh/jquery.whiny.js

Alters the jQuery library so the jQuery() method will trigger a console warning if an empty jQuery object is returned. Strictly for dev purposes!
https://github.com/mjc-gh/jquery.whiny.js

Last synced: 3 months ago
JSON representation

Alters the jQuery library so the jQuery() method will trigger a console warning if an empty jQuery object is returned. Strictly for dev purposes!

Awesome Lists containing this project

README

          

We've all done something like this:

$('#id').text('new text');

And wondered why the code wasn't working only to find out the selector was wrong. jQuery.whiny.js attempts to solve this problem by altering the jQuery library so that the jQuery() method will trigger a console warning if an empty jQuery object is returned.

In the above example, if '#id' returned an empty jQuery object you would see the following console warning:

"jQuery was called with a selector of '#id' and returned an empty object"

Note: This is strictly for dev purposes!

Additionally, the name of this script was inspired by "whiny nil" from Ruby on Rails.