我试图弄清楚如何将元素 id 传递给仅执行 php 代码的弹出窗口。单击链接时,它会获取链接 id,打开弹出窗口,我如何获取要传递的 id?
JS:
$(document).on('click', '.char_inventory', function (e) {
c = true;
var id = e.currentTarget.id;
//alert(id);
if (id == "close_inventory") {
$("#console").html("<div id=\"placeholder\"></div>");
c = false;
} else {
/* $.post('input_commands/inventory_show.php',{id:id}, function(data) {
text=data;
elem = $("#console");
//delay=100;
elem.html(text);
}); */
function popUp(target, id) {
//var id = parent.document.getElementById('id').value;
popWin = window.open(target, "windowName", "width=400,height=250,status=yes");
}
popUp("input_commands/inventory_show.php", id);
}
load();
//setTimeout(function(){c=false;},4000);
});