This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes how to restrict facebook related code when user access from china Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to restrict facebook related code when user access from china" Watch "how to restrict facebook related code when user access from china" New topic
Author

how to restrict facebook related code when user access from china

chaitanya pai
Greenhorn

Joined: Aug 24, 2011
Posts: 1
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.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to restrict facebook related code when user access from china