Many times it happen when you open a webpage in your browser whole page loads just fine but not facebook like button, facebook page feed, twitter share button, linkedin share button, google plus one button etc.
It is because of browser addons/plugins, like avast online security, Adblock plus etc., block them.
Well it is no problem for visitors but webmaster do not like it much. Here are few solutions that find out if social plugins like Facebook, Twitter, Linkedin have been blocked by browser 's add-on/plugin.
Facebook
You can also detect google plus, pinterest and other social network JS library on your website using similar method.
It is because of browser addons/plugins, like avast online security, Adblock plus etc., block them.
Well it is no problem for visitors but webmaster do not like it much. Here are few solutions that find out if social plugins like Facebook, Twitter, Linkedin have been blocked by browser 's add-on/plugin.
Insert jQuery API
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">
$(window).load(function(){
if(typeof window.FB == 'undefined'){
alert('Facebook SDK is unable to load, display some alternative content for visitor');
}
else{
alert('Facebook is working just fine');
}
});
</script>
$(window).load(function(){
if(typeof window.FB == 'undefined'){
alert('Facebook SDK is unable to load, display some alternative content for visitor');
}
else{
alert('Facebook is working just fine');
}
});
</script>
Twitter Script
<script type="text/javascript">
$(window).load(function(){
if(typeof window.__twttrlr == 'undefined'){
alert('Twitter SDK is unable to load, display some alternative contect for visitor');
}
else{
alert('Twitter is working just fine');
}
});
</script>
$(window).load(function(){
if(typeof window.__twttrlr == 'undefined'){
alert('Twitter SDK is unable to load, display some alternative contect for visitor');
}
else{
alert('Twitter is working just fine');
}
});
</script>
Linkedin Script
<script type="text/javascript">
$(window).load(function(){
if(typeof window.IN == 'undefined'){
alert('Linkedin SDK is unable to load, display some alternative contect for visitor');
}
else{
alert('Linkedin is working just fine');
}
});
</script>
$(window).load(function(){
if(typeof window.IN == 'undefined'){
alert('Linkedin SDK is unable to load, display some alternative contect for visitor');
}
else{
alert('Linkedin is working just fine');
}
});
</script>
You can also detect google plus, pinterest and other social network JS library on your website using similar method.
0 comments:
Post a Comment