好的,我一直在努力尝试使用 jquery mobile 将参数从页面传递到弹出 div(在同一页面内)。我只想能够在弹出窗口中编辑数据库中的项目。这是我要更新的项目数组:
<div class="ui-block-c">
<?php
$fam_mem = $_db->rows('SELECT * from family_member', array());
foreach($fam_mem as $f)
{
echo "<a href='?id=$f[member_ID]#edit_fam_mem' data-mini='true' data-theme='d' data-inline='true' data-role='button' data-rel='popup' data-position-to='window' data-transition='pop' data-icon='gear' data-iconpos='notext'>Edit</a>";
echo "<a href='?id=$f[member_ID]#delete_fam_mem' data-mini='true' data-theme='d' data-inline='true' data-role='button' data-rel='popup' data-position-to='window' data-transition='pop' data-icon='delete' data-iconpos='notext'>Delete</a>";
}
?>
</div> <!--End ui-block-c-->
这是弹出 div 的代码:
<div data-role="popup" id="delete_fam_mem" data-theme="d" data-overlay-theme="b" class="ui-content" style="max-width:340px;">
<?php //include_once("./delete_fam_mem.php");?>
<h3>Delete Family Member</h3>
<?php
echo "id is ", $_GET[id]; exit;
$del = $_db->query("DELETE FROM family_member WHERE member_ID = ", array($_GET[id]));
if ( $del )
echo "Chore $_GET[title] deleted successfully.";
else "Could not be deleted, maybe you should go to counseling.";
?>
<button class="button" onclick='closefancy()'>OK!</button>
</div> <!--End Delete Family Member-->
出于某种原因,它不会将页面中的 id 传递给弹出窗口。任何帮助将不胜感激!谢谢!