Created
July 19, 2011 23:43
-
-
Save Rob-ot/1094018 to your computer and use it in GitHub Desktop.
Empty image src checker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // put in head right after jquery | |
| (function () { | |
| function check ($e) { | |
| if ($e.attr("src") == "") { | |
| console.log($e) | |
| } | |
| } | |
| $(window).bind("DOMNodeInserted", function (e) { | |
| var t = $(e.target) | |
| if (t.is("img")) { | |
| check(t) | |
| } | |
| else { | |
| t.find("img").each(function () { | |
| check($(this)) | |
| }) | |
| } | |
| }) | |
| $(function () { | |
| $("img").each(function () { | |
| check($(this)) | |
| }) | |
| }) | |
| }()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment