JSON Server and Facebook

Events happening in the community are now at Drupal community events on www.drupal.org.
ebeyrent's picture

I am currently using Flex to consume an amfphp service, and it works great. However, when you try to use the swf on a Facebook profile, you have to click on an image first in order to load the swf.

My thought was to use the JSON server to return JSON to my facebook app. However, I get hit with the cross domain security issue. Has anyone here successfully accessed the JSON Server from a remote domain?

-Erich-

Comments

+1

toursheet's picture

Looking at building a browser extension widget, this might be an issue for us as well - +1

In looking at the code for

ebeyrent's picture

In looking at the code for the JSON server, I noticed that it only supports POSTs. I added a litte GET functionality, and then I was able to do this (with some ugly non-jQuery javascript):

function get(){
  headElement = document.getElementsByTagName("head").item(0);
  var script = document.createElement("script");
  script.setAttribute("type", "text/javascript");
  script.setAttribute("src","http://server.com/services/json?method=views.getView&view_name=some_view&callback=display");
  headElement.appendChild(script);
}

function display(obj){
  var theDiv = document.createElement("div");
  theDiv.innerHTML = obj.data;
  document.body.appendChild(theDiv);
}

I am a bit concerned about the security implications of allowing GET requests to the JSON server. Any thoughts on this?

Issue Queue

robloach's picture

If you submit a patch to the issue queue, Dmitri will have a chance to see it and give his insights on the matter. I see no problem with using GET to make requests.

Done -

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: