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!
- Host: GitHub
- URL: https://github.com/mjc-gh/jquery.whiny.js
- Owner: mjc-gh
- Created: 2011-07-12T03:50:35.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2012-06-14T13:48:53.000Z (over 13 years ago)
- Last Synced: 2025-06-29T02:43:45.268Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 99.6 KB
- Stars: 3
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README
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.