Alexander Nazarov (nfokz) wrote in changelog,
Alexander Nazarov
nfokz
changelog

[livejournal] r22311: LJSUP-12665: Can't see price on some pag...

Committer: anazarov
LJSUP-12665: Can't see price on some pages
U   trunk/htdocs/js/journal.js
Modified: trunk/htdocs/js/journal.js
===================================================================
--- trunk/htdocs/js/journal.js	2012-06-22 12:57:07 UTC (rev 22310)
+++ trunk/htdocs/js/journal.js	2012-06-22 12:58:37 UTC (rev 22311)
@@ -434,9 +434,13 @@
 
 			toInit.forEach(function(like) {
 				var jEl = jQuery(like.el),
-					likeHtml = jEl.html();
+					internal = (jEl.get(0) || {}).childNodes;
+
+				if (!internal || !internal[0]) {
+					return;
+				}
 				
-				jEl.html(likeHtml.slice(4, -3)); // strip '<!--' and '-->'
+				jEl.html(internal[0].nodeValue); // strip '<!--' and '-->'
 				LiveJournal.parseLikeButtons(jEl);
 
 				like.init = true;

Tags: anazarov, js, livejournal, nfokz
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments