admin管理员组文章数量:1391934
I'm trying to do table where pressing on ID, it opens popup window, where will be menu, for example, change row values, add ments.. But I have a problem with generating link for each row:
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
P.S. I'm using Wordpress.
I'm trying to do table where pressing on ID, it opens popup window, where will be menu, for example, change row values, add ments.. But I have a problem with generating link for each row:
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
P.S. I'm using Wordpress.
Share Improve this question asked Aug 25, 2015 at 7:29 AlexILAlexIL 5733 gold badges9 silver badges24 bronze badges 5- What is the exact problem you are having? It is not clear from your post. – raduation Commented Aug 25, 2015 at 7:32
-
Be careful with those quotation marks in your
a
element:onclick="javascript:window.open("http...
closes theonclick
section right after the opening bracket! – Hexaholic Commented Aug 25, 2015 at 7:37 - Problem is that, it's not working on click – AlexIL Commented Aug 25, 2015 at 7:47
-
@AlexIL as @Hexaholic says the problem is with your
a
tag quotations, you are placing"
inside of"
for onclick value. If we won't use proper quotations, then thea
tag output will not e as expected. Use escape characters,onclick="javascript:window.open(`http....
– Srinu Chinka Commented Aug 25, 2015 at 7:57 - can you please help me to write right quotations in this code? – AlexIL Commented Aug 25, 2015 at 8:05
1 Answer
Reset to default 3HTML Code
<?php $id=1;?>
<a href="" onClick="popitup('popup1.php?id=<?php echo $id;?>')">Open</a>
Javascript Code
<script type="text/javascript">
function popitup(url) {
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
}
</script>
本文标签: javascriptPopup window inside php codeStack Overflow
版权声明:本文标题:javascript - Popup window inside php code - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744721156a2621703.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论