简体   繁体   English

厚盒和ajax

[英]thickbox and ajax

I have a little problem that I just can't figure out. 我有一个小问题,我想不通。 I'd like to post data to server (php) and then after processing display the result with thickbox iframe. 我想将数据发布到服务器(php),然后在处理后用thickbox iframe显示结果。

I looked at ajax example from thickbox, but there's no passing, processing and returning at the same time. 我看了来自thickbox的ajax示例,但没有同时进行传递,处理和返回。 The basic example works for me. 基本示例对我有用。

Any ideas? 有任何想法吗?

Thanks! 谢谢! Newman 新人

Did you read this part? 你读过这部分吗?

Description: Use a hidden HTTP request (AJAX) to fetch files from the same server and have ThickBox display the contents of the files. 描述:使用隐藏的HTTP请求(AJAX)从同一服务器获取文件,并让ThinBox显示文件的内容。 Instructions: Create a link element () Give the link a class attribute with a value of thickbox (class="thickbox") Provide a path in the href to the file/directory on the server. 说明:创建一个link元素()为该链接赋予一​​个class属性,其属性值为thinbox(class =“ thickbox”)。在href中提供指向服务器上文件/目录的路径。 (href="ajaxLogin.htm") In the href attribute, after the URL path to the file, add the following query on to the end of the URL: ?height=300&width=300 Change the values of height and width in the query accordingly Optionally you may add modal=true to the query string (eg ?height=300&width=300&modal=true) so that closing a ThickBox will require calling the tb_remove() function from within the ThickBox. (href =“ ajaxLogin.htm”)在href属性中,文件的URL路径之后,将以下查询添加到URL的末尾:?height = 300&width = 300更改查询中的height和width值相应地,您可以选择向查询字符串中添加modal = true(例如?height = 300&width = 300&modal = true),以便关闭ThickBox将需要从ThickBox中调用tb_remove()函数。 See the login example, where you must click cancel to close the ThickBox. 请参阅登录示例,在该示例中必须单击“取消”以关闭ThinBox。 Important to Remember: In order to open new Ajax content in an open Ajax ThickBox, its code must also contain the appropriate HTML (class=""thickbox) to launch an Ajax ThickBox (see demo for example). 要记住的重要事项:为了在打开的Ajax ThickBox中打开新的Ajax内容,其代码还必须包含适当的HTML(class =“” thickbox)以启动Ajax ThickBox(例如,参见演示)。 The only catch is, the ThickBox calls must include both the width and height of the original ThickBox. 唯一的问题是,ThickBox调用必须同时包含原始ThinBox的宽度和高度。 If you leave it blank the window will resize to the default size(630x440). 如果将其保留为空白,则窗口将调整为默认大小(630x440)。

The example and it's description make sense. 该示例及其说明很有意义。 You are not preforming the AJAX request - ThickBox does that based on the href value of the link with the class ThickBox, and loads that data into the resulting ThickBox. 您不是在执行AJAX请求-ThickBox会基于与ThickBox类的链接的href值执行该请求,并将该数据加载到生成的ThickBox中。

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

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