Remove Facebook Likebox on smaller screen / mobile devices

Is there a method to not display and important not load the Facebook Likebox on devices with a certain screen size (for example: not on smartphones) or certain data connection (not wifi), the likebox slows down the website significantly.

So the method display:none; is no option.


Currently there's no way to (reliably) query for data connection type.

May I suggest a different approach? perhaps you could load the likebox on demand using javascript, the way or do it. Those sites load the social buttons only when you hover over some placeholder images.

This way, you optimize not only for mobile screens but for all devices. If you still want, you could check the viewport size before loading the buttons, or use display:none inside a media query so the placeholder images are not shown –and the buttons can't be loaded.

Why not a simple echo based on a conditional ?

For connection you would get the users speed perhaps using a bit of code like this:

Then an if statement if the speed is above say 56k, output the likebox code?

For mobiles, you would do the same after getting the browsers user agent.

Need Your Help

Not able to solve import on Eclipse

android eclipse google-app-engine google-cloud-storage

I am trying to serve a blob , which take objects from GCS and serve it . In my servlet I need to import:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.