{"id":6259,"date":"2014-04-15T07:53:47","date_gmt":"2014-04-15T07:53:47","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/15\/update-fblike-url-dynamically-using-javascript-collection-of-common-programming-errors\/"},"modified":"2014-04-15T07:53:47","modified_gmt":"2014-04-15T07:53:47","slug":"update-fblike-url-dynamically-using-javascript-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/15\/update-fblike-url-dynamically-using-javascript-collection-of-common-programming-errors\/","title":{"rendered":"Update FB:Like URL Dynamically using JavaScript-Collection of common programming errors"},"content":{"rendered":"<p>For reinit social buttons i use this code:<\/p>\n<pre><code>\/\/Facebook like\nif(typeof(FB) !== 'undefined')\n     FB.XFBML.parse(document.getElementById('fblike'));\n\n\/\/Google plus one\nif(typeof(gapi) !== 'undefined') {\n    gapi.plusone.render(document.getElementById('gplus'),{\n        'href':location.href,\n        'annotation':'bubble',\n        'width': 90,\n        'align': 'left',\n        'size': 'medium'\n    });\n}\n\n\/\/Twitter tweet button\nif(typeof(twttr) !== 'undefined') {\n    $('.twitter-share-button').attr('data-url',location.href);\n    twttr.widgets.load();\n}\n<\/code><\/pre>\n<p>With html code like this:<\/p>\n<pre><code>\n    \n\n\n    Tweet\n\n\n    \n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>For reinit social buttons i use this code: \/\/Facebook like if(typeof(FB) !== &#8216;undefined&#8217;) FB.XFBML.parse(document.getElementById(&#8216;fblike&#8217;)); \/\/Google plus one if(typeof(gapi) !== &#8216;undefined&#8217;) { gapi.plusone.render(document.getElementById(&#8216;gplus&#8217;),{ &#8216;href&#8217;:location.href, &#8216;annotation&#8217;:&#8217;bubble&#8217;, &#8216;width&#8217;: 90, &#8216;align&#8217;: &#8216;left&#8217;, &#8216;size&#8217;: &#8216;medium&#8217; }); } \/\/Twitter tweet button if(typeof(twttr) !== &#8216;undefined&#8217;) { $(&#8216;.twitter-share-button&#8217;).attr(&#8216;data-url&#8217;,location.href); twttr.widgets.load(); } With html code like this: Tweet<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6259","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6259"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6259\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}