[英]Popup window inside php code
I'm trying to do table where pressing on ID, it opens popup window, where will be menu, for example, change row values, add comments.. But I have a problem with generating link for each row: 我正在尝试在表格上按ID,它会打开弹出窗口,在这里将出现菜单,例如,更改行值,添加注释。。但是我为每行生成链接时遇到问题:
foreach ($results as $row) {
// Each $row is a row from the query
$rowid = $row->ID;
echo '<tr><td>';
echo '<a href="#" onclick="javascript:window.open("http://192.168.210.140/todolist/controls-menu?funnelid="'.$rowid.',"Controls Menu","width= 700,height= 500,toolbar= no,location= no,directories= 0,status= no,menuBar= no,scrollBars= no,resizable= yes,left= 400,top= 150,screenX= 400,screenY= 150");">'.$rowid.'</a>';
Maybe it's need to add 也许需要添加
<script type="text/javascript>
... Some script when pressing <a href="#">
</script>
But I have no idea, how to detect from script which link is pressed, for example is it 但是我不知道如何从脚本中检测出按下了哪个链接,例如
http://192.168.210.140/todolist/controls-menu?funnelid=999
OR 要么
http://192.168.210.140/todolist/controls-menu?funnelid=1100
PS I'm using Wordpress. PS我正在使用Wordpress。
HTML Code HTML代码
<?php $id=1;?>
<a href="" onClick="popitup('popup1.php?id=<?php echo $id;?>')">Open</a>
Javascript Code JavaScript代码
<script type="text/javascript">
function popitup(url) {
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
}
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.