简体   繁体   English

JQUERY UI-选项卡-将数据加载到选项卡中,而无需使用IFRAME-替代选项

[英]JQUERY UI - tabs - load data into a tab, without using IFRAME - Alternative options

I currently have a JSP page, containing a Jquery UI based accordion (based on left hand side of the page), that in turn when you select an option in this accordion, it launches a new tab (the tabs are based in the centre of the page) 我目前有一个JSP页面,其中包含一个基于Jquery UI的手风琴(基于页面的左侧),当您在该手风琴中选择一个选项时,它会启动一个新选项卡(这些选项卡位于这一页)

The content that is loaded into my new tab, is from a JSP page that I have within my project. 加载到我的新选项卡中的内容来自项目中的JSP页面。 I am doing this with IFRAME, but I wonder if there is a way to load this JSP's data into the tab without it being an IFRAME? 我正在使用IFRAME进行此操作,但是我想知道是否有一种方法可以将JSP的数据加载到选项卡中而不将其作为IFRAME?

This JSP contains a dynamic data, images and text. 该JSP包含动态数据,图像和文本。

It would be cleaner if it was output displayed within the tab itself and not an IFRAME - the usability for this isn't great. 如果将其输出显示在选项卡本身而不是IFRAME中,则会更整洁-实用性不是很好。

What alternative options to IFRAME could I have for doing this? 我可以为IFRAME选择哪些替代方案?

You can use jQuery's load function, it is very simple and easy to use. 您可以使用jQuery的load函数,它非常简单易用。

A good example of this can be seen here: http://jsfiddle.net/SO_AMK/TR2kn/ (click expand) 一个很好的例子可以在这里看到: http : //jsfiddle.net/SO_AMK/TR2kn/ (单击展开)

A simpler example: http://jsfiddle.net/SO_AMK/TR2kn/1/ 一个简单的示例: http : //jsfiddle.net/SO_AMK/TR2kn/1/

But, please be warned that this cannot load data across domains so the data must be on your server (there are some workarounds but they get complicated)! 但是,请注意,这无法跨域加载数据,因此数据必须在您的服务器上(有一些解决方法,但是它们变得复杂)!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM