我尝试将此行添加到我的PHP代码中:
<a href="#" onClick="window.open('yourpage.htm','pagename','resizable,height=640,width=360'); return false;">New Page</a>
PHP:
$html_table .= "<td> <a href="#" onClick="window.open('mypage.htm','pagename','resizable,height=640,width=360'); return false;"><button type='button' class='btn btn-success'>test</button></a></td>";
但是它不能与"
一起使用。
更改我的代码的最佳方法是什么?
谢谢
答案 0 :(得分:1)
您需要转义引号:
<?php
$html_table .= "<td> <a href=\"#\" onClick=\"window.open('mypage.htm','pagename','resizable,height=640,width=360'); return false;\"><button type='button' class='btn btn-success'>test</button></a></td>";