Valerii Vasin (valerii) wrote in changelog,
Valerii Vasin
valerii
changelog

[livejournal] r23224: LJSUP-14136: Optimize like buttons parsi...

Committer: vvasin
LJSUP-14136: Optimize like buttons parsing. Fix facebook buttons overhead loading.
U   trunk/htdocs/js/livejournal.js
Modified: trunk/htdocs/js/livejournal.js
===================================================================
--- trunk/htdocs/js/livejournal.js	2012-10-31 09:09:02 UTC (rev 23223)
+++ trunk/htdocs/js/livejournal.js	2012-10-31 09:19:44 UTC (rev 23224)
@@ -354,7 +354,7 @@
 	base = base.replace(/(\&|\?)+$/g, '');
 	var queryStr = base,
 		queryArr = [];
-	
+
 	if (args) {
 		queryStr += ( base.indexOf('?') === -1 ? '?' : '&' );
 
@@ -409,8 +409,10 @@
 
 LiveJournal.parseLikeButtons = function(ctx) {
 	try {
-		FB.XFBML.parse();
-	} catch(e) {}
+		window.FB.XFBML.parse( jQuery(ctx).find('[action=recommend]').parent().get(0) );
+	} catch (e) {
+		console.warn(e.message);
+	}
 
 	try {
 		if (jQuery.browser.msie) {
@@ -766,7 +768,7 @@
 };
 
 LiveJournal.showWidgets = function() {
-	
+
 	function random() {
 		return 	'rgb(' + (Math.floor((256-199)*Math.random()) + 200) + ','
 		+ (Math.floor((256-199)*Math.random()) + 200) + ','

Tags: invis89, js, livejournal, vvasin
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