From 9373b26625fc46ea508e2dcb29d0e7b94bba4a6d Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 14 Mar 2012 15:06:30 +0000 Subject: [PATCH] In jquery, $("#foo") is always true (an empty object) --- lib/shimmie.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/shimmie.js b/lib/shimmie.js index b277b834..7b5ef6f3 100644 --- a/lib/shimmie.js +++ b/lib/shimmie.js @@ -43,7 +43,7 @@ $(document).ready(function() { $(".shm-clink").each(function(idx, elm) { 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 // switching pages $(elm).attr("href", target_id);