我已经实现了以下代码,用于在jQuery对话框中上传照片(使用iframe)。关闭Iframe中的jQuery UI对话框
这里的I帧
<div style="display: none">
<iframe id="upload-form" frameborder="0" marginheight="0" marginwidth="0" src="Upload.aspx"></iframe>
</div>
下面是这需要打开该对话框的护理父页上的jQuery代码。
$("#upload-image").click(function (e) {
e.preventDefault();
$('#upload-form').dialog({
modal: true,
width: 300,
title: "Upload Image",
autoOpen: true,
close: function(event, ui) { $(this).dialog('close') }
});
});
我再注射后上传脚本(iframe的页面上)是成功的,其传递一个结果回父页面,但我想在同一时间关闭对话框。
$(document).ready(function() {
$(parent.document).find('#imagePathValue').val('theimagevalue');
$(parent.document).find('#upload-form').dialog('close');
});
的表被成功过去了,但我似乎无法能够关闭对话框。
任何想法?
这就是交配,谢谢! :) – Marko 2010-12-08 21:35:35