【发布时间】:2016-02-16 10:01:43
【问题描述】:
我在一个 php 页面上有多个项目,要编辑每个项目,我想将按钮的标题作为参数发送到 iFrame(弹出窗口),我该怎么做?
我有这样的代码:
<button class="btn_edit ui-button-text-only" title="245" role="button" aria-disabled="false"><span class="ui-button-text">Edit this item</span></button>
<button class="btn_edit ui-button-text-only" title="246" role="button" aria-disabled="false"><span class="ui-button-text">Edit this item</span></button>
<button class="btn_edit ui-button-text-only" title="247" role="button" aria-disabled="false"><span class="ui-button-text">Edit this item</span></button>
<button class="btn_edit ui-button-text-only" title="248" role="button" aria-disabled="false"><span class="ui-button-text">Edit this item</span></button>
<button class="btn_edit ui-button-text-only" title="249" role="button" aria-disabled="false"><span class="ui-button-text">Edit this item</span></button>
itemID = 标题变量。
获得类似结果:iframe src="index.php?type=1296727025&itemID.
我尝试append()但没有成功,
$dialog_edit.append($("<iframe class='no-border full-width-height' />").attr("src", "index.php?type=1296727025&tx_productmanager_pi1="+productID+"&no_cache=1"));
$dialog_edit.dialog('open');
有人有想法吗?
【问题讨论】:
-
append()的其他代码是什么? -
我的附加代码是这样的: $('.btn_edit_product').click(function() { var productID = $(this).attr('title'); $dialog_edit.append($( "").attr("src", "index.php?type=1296727025&tx_productmanager_pi1[productID]="+productID+"&no_cache=1")); alert (productID); // 此警报显示产品 ID $dialog_edit.dialog('open'); return false; });
标签: javascript php jquery html iframe