开发者

Tabbed javascript widget for a Rails app

开发者 https://www.devze.com 2022-12-29 13:48 出处:网络
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

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'开发者_JS百科 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?


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.

0

精彩评论

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

关注公众号