views:

39

answers:

2

I am about to build a web application and I want to allow other developers extend it with their own applications.

Should I do this with iFrames like Facebook?

Is this a good practice?

Are there other alternatives that let other developers extend my application (that is for the user it looks like it's from my application).

To be specific:

I want developers to be able to code applications that is embedded on my web application. Eg. if I have a file on my application they could provide a way for the users to interact with that file. Maybe a "preview" application that let the users preview the file.

Another application might draw a mindmap tree view of all the user's files.

What is the best way of doing this?

  • iFrame + Restful API on backend for data exchange?
  • Let them insert javascript on backend + frontend + html + css on my web application?
  • Other alternatives?
A: 

It depends on what you mean by "extend". When you use iFrames with 3rd parties, presumably vended from different domains than the host page, then you are constrained by cross-domain issues and cannot interact with the contents of those iFrames. If that's not an issue for you, then you can go ahead and try that strategy, but I can't see how merely adding iFrames without interopability is "extending" your web application.

Robusto
But isn't this what Facebook is doing? How do they provide the data from Facebook's domain to the iFrame domain? Through the backend? Facebook does ajax to server side -> restful API to the iFrame application -> iFrame application displays content and the user sees it on the iFrame?.
weng
+1  A: 
mu is too short
Please read the comment on Robusto's answer. Isn't that how Facebook is doing with iFrame apps? In that way, the iFrame app can still communicate with Facebook, but in it's own domain hence they cannot break anything on Facebook. Isn't it a security risk if Facebook let people run Javascript on Facebook? Is that what you meant?
weng
Read my updated question.
weng