Skip to content

Instantly share code, notes, and snippets.

@Rob-ot
Created July 19, 2011 23:43
Show Gist options
  • Select an option

  • Save Rob-ot/1094018 to your computer and use it in GitHub Desktop.

Select an option

Save Rob-ot/1094018 to your computer and use it in GitHub Desktop.
Empty image src checker
// 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