As almost all developers use to add social buttons at their websites i decided to write a small
text with my experience. The main problem we face usually is that button code loads in a blocking way
and slows down page especially if a social network server is busy or down.
Will write down the snippet for 4 major buttons :

Starting with facebook like button, facebook developers site provides a snippet that loads
the button code asynchronously :

<div id=”fb-root”></div>
<script>
window.fbAsyncInit = function() {
FB.init({
status     : true, // check login status
cookie     : true, // enable cookies to allow the server to access the session
xfbml      : true  // parse XFBML
});

// Additional initialization code here
};

// Load the SDK Asynchronously
(function(d){
var js, id = ‘facebook-jssdk’, ref = d.getElementsByTagName(‘script’)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(‘script’); js.id = id; js.async = true;
js.src = “//connect.facebook.net/en_US/all.js”;
ref.parentNode.insertBefore(js, ref);
}(document));
</script>

Do not forget to add appid variable if using facebook’s connect option

For the next 3 buttons code provided by hosts is this :

<script type=”text/javascript” src=”https://apis.google.com/js/plusone.js”></script>
<script type=”text/javascript” src=”http://platform.twitter.com/widgets.js”></script>
<script type=”text/javascript” src=”http://platform.linkedin.com/in.js”></script>

For most sites this snippet will work fine and all 3 buttons will appear correctly.
In order to load the buttons asynchronously and do not  interrupt the main page loading i
wrote down this snippet that is better to put before you close body tag (usually will be at footer).

<script type=”text/javascript” >
(function() {
var twitterTag = document.createElement(‘script’);
twitterTag.type = ‘text/javascript’;
twitterTag.async = true;
twitterTag.src = ‘http://platform.twitter.com/widgets.js’;
var s = document.getElementsByTagName(‘script’)[0];
s.parentNode.insertBefore(twitterTag, s);
})();
</script>

<script type=”text/javascript” >
(function() {
var googleplusTag = document.createElement(‘script’);
googleplusTag.type = ‘text/javascript’;
googleplusTag.async = true;
googleplusTag.src = ‘https://apis.google.com/js/plusone.js’;
var s = document.getElementsByTagName(‘script’)[0];
s.parentNode.insertBefore(googleplusTag, s);
})();
</script>

<script type=”text/javascript” >
(function() {
var linkedinshareTag = document.createElement(‘script’);
linkedinshareTag.type = ‘text/javascript’;
linkedinshareTag.async = true;
linkedinshareTag.src = ‘http://platform.linkedin.com/in.js’;
var s = document.getElementsByTagName(‘script’)[0];
s.parentNode.insertBefore(linkedinshareTag, s);
})();
</script>

Code is tested in many sites and everything loads smoothly.

Have a good day

 

The lower price for registering .TV domains has been extended until the end of September.

Great News for tvers

Pricing is $10.75/yr for superbulk and $10.99/yr for bulk customers.

 

Premium .me Sedo auction

On May 31, 2012, in Domains, by manos

Today ended .me Registry premium auction at sedo (180 names)

Here is top 10 :
cruise.me  28,500 USD
air.me        10,099 USD
legal.me     8,100  USD
malta.me   8,100  USD
restaurant.me 6,618 USD
files.me 5,500 USD
japan.me 5,269 USD
oil.me 5,000   USD
sydney.me 3,109 USD
777.me 2,900 USD

Will put full final list at next post

thanks for reading

 

 

Hello world!

On May 29, 2012, in General, by manos

Starting my blog today. Decided to keep the default hello world title 🙂

 
spy app for