尝试让这段代码起作用:
echo '<div class="assignsuccess">Success! The report has been assigned to you. <b><a href="javascript:ajaxpage("view.php?callid='.$getcallid.'", "dashwrap");">Press here to view it.</a></b></div>';
但是,当我将鼠标悬停在网站上的链接上时,我可以看到它在第一个javascript:ajaxpage(
处断开,我不明白为什么。我知道将JavaScript与PHP一起使用会很棘手,特别是如果它在代码中,但我不明白为什么这不起作用。我已尝试将"
与'
切换,但这并没有改变任何内容。
答案 0 :(得分:3)
试试这个:
echo '<div class="assignsuccess">Success! The report has been assigned to you. <b><a href="javascript:ajaxpage(\'view.php?callid='.$getcallid.'\', \'dashwrap\');">Press here to view it.</a></b></div>';
应呈现:
<a href="javascript:ajaxpage('view.php?callid=', 'dashwrap');">