views:

28

answers:

1

A user registers on our Rails app and they're given javascript to embed a widget in their website. The widget has a tabbed interface, like the JQuery tabs http://stilbuero.de/jquery/tabs_3/. iFrames have been tested, but the widget form factor and cross-domain policy negates the use of iframes. The widget is very dynamic and will often update the DOM with new content - and because of cross-domain policy, it looks as though JSONP is necessary.

I understand that 'widget.js.erb' needs to create the widget layout, reference a stylesheet, render the tabs, etc - but once a tab is clicked, how does the widget request the content from the Rails app and render it in the DOM?

A: 

jQuery Tabs hold HTML divs much as a normal HTML page does. Think of each tab as simply hiding the HTML content in other tabs that without jQuery Tabs would be displayed.

mcandre