• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to restrict facebook related code when user access from china

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have a page where facebook plugin need to be loaded and displayed. It is working fine. But if user try to access the same page from china, where facebook is blocked, page loading is taking too much time.
This is because my page is keep on trying to connect to facebook to download the page and connection timed exception is coming. Can any one of you help me resolving this problem.

I think the implementation can be some thing like, first check whether the user network allows facebook or not. If it allows then download the plugin otherwise dont download the plugin. But dont know how to achieve this.

Any suggestions would be of great help

Thanks in advance,

Chaitanya.
 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can check the IP address of the request, and then use an API like Maxmind GeoIP to figure out the country from that - if it's China, serve appropriate content.
 
reply
    Bookmark Topic Watch Topic
  • New Topic