开发者

Which javaScript framework for cross-domain?

开发者 https://www.devze.com 2022-12-08 19:39 出处:网络
I am building a web service that will make heavy use of cross-domain GET and POST data, and then update some lightbox or similar windows on the client.

I am building a web service that will make heavy use of cross-domain GET and POST data, and then update some lightbox or similar windows on the client.

Is th开发者_StackOverflow中文版ere one JavaScript framework that is better at this, or more importantly, a framework which I should avoid?

  • I want to be able to put controls in the boxes. Really sexy boxes would be nice. These will be updated without page reloads.

  • Framework needs to be really good at the cross-domain stuff. I need good error trapping and process confirmation so that I can show the user that his connections are active.

I can use more than one framework if necessary. The bandwidth might be justified if one framework was really good at cross-domain and another was really good at windows/boxes.

Thanks,

EDIT: With regard to which frameworks to avoid, I am thinking in terms of gotchas.


I would suggest using jQuery as it's probably one of the most widespread (if not "the") javascript frameworks. There are numerous jQuery addons for sexy boxes (you just have to google), you can have it to work cross-domain

As for which frameworks to avoid: the ones that don't have an active developer community behind them, just see how often releases and fixes are released.


My favourite Javascript Framework is YUI 2.

It has a very good documentation, is actively developed since about 3 years by a big company (YAHOO). The widgets provided with the library are well structured and can be easily configured. Moreover I had never the need to rely on any 3rd party plugin (except once I needed an accorion widget), all what I need comes with the YUI or what is also very important: it can be done with what the library offers. That is something I really appreciate. I used it in all my projects since 2008 and I never got disappointed.

The packages which are especially interesting for you:

The Connection Manager: http://developer.yahoo.com/yui/connection/
and the Overlay Component: http://developer.yahoo.com/yui/container/overlay/index.html


Another alternative is Dojo (documentation found here).

Biggest problems I've had with Dojo:

  1. Big changes across versions
  2. Relatively mediocre documentation

In its defense, I will say that Dojo's xhrPost and xhrGet commands are pretty solid, if that's all you're using the framework to do.

One of its libraries, Dijit, also has some neat looking widgets - only some of which work as advertised (i.e. "out of the box").

Nevertheless, it's far better than writing your own cross-browser JavaScript.

Good luck!


I would say JSONP from jQuery, but lately I've seen this video from Google for cross domain calls.


For the cross-domain part I would recommend easyXDM.

Demos of this can be viewed here, I'm guessing this example is fitting for your application


I recommend jQuery, it's probably the most popular one out there.

0

精彩评论

暂无评论...
验证码 换一张
取 消