In jquery, $("#foo") is always true (an empty object)

This commit is contained in:
Shish 2012-03-14 15:06:30 +00:00
parent e67d679194
commit 9373b26625

View File

@ -43,7 +43,7 @@ $(document).ready(function() {
$(".shm-clink").each(function(idx, elm) { $(".shm-clink").each(function(idx, elm) {
var target_id = $(elm).data("clink-sel"); var target_id = $(elm).data("clink-sel");
if(target_id && $(target_id)) { if(target_id && $(target_id).length > 0) {
// if the target comment is already on this page, don't bother // if the target comment is already on this page, don't bother
// switching pages // switching pages
$(elm).attr("href", target_id); $(elm).attr("href", target_id);