[英]closing jquery dialog from an iFrame
我創建了一個帶有iframe的jquery對話框,它是一個表單,我希望當用戶點擊取消或在對話框中提交表單時關閉對話框...
$( "#dialog" ).dialog( "option", "title",["Create"] );
$( "#dialog" ).dialog( "open" );
$("#dialog-content").html("<iframe id='iframe_manage' width='825px' height='800px' class='popup_iframe' src='manage.php?PME_sys_operation=Add&pv=popup'></iframe>");
想法?
我試過這樣的東西..
$("#iframe_manage").load(function () {
$('input[name=PME_sys_canceladd]').click(function() {
alert('Handler for .submit() called.');
//$('input[name=PME_sys_canceladd]').submit();
});
});
但似乎沒有拿起按鈕上的點擊事件..
我想你應該這樣做
$("iframe").contents().find()
而不是只使用$()。
所以也許這會奏效:
$("#iframe_manage").load(function () {
$("#iframe_manage").contents().find('input[name=PME_sys_canceladd]').click(function() {
alert('Handler for .submit() called.');
//$('input[name=PME_sys_canceladd]').submit();
});
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.