在php中创建一个弹出窗口

时间:2011-10-22 02:13:46

标签: php javascript

您好我正在使用这段PHP代码,现在它只是显示一个字段列表。 如何在php中将其设置为弹出窗口? 我试过插入javascript,但php + javascript一起让我很困惑。非常感谢你的帮助!

$output .= '
<div class="item-list">
<ul><li class="first">
<a target="_blank" href="/drupall/user/register" title="Create a new user account.">Create new    account</a></li>
<li class="last">
<a href="/drupall/user/password" title="Request new password via e-mail.">Request new password</a></li>';

4 个答案:

答案 0 :(得分:0)

"<"a href = "popup.html" target = "_blank" onclick="popupCode();return false;" ">"

如果你有javascript,应该打开一个弹出窗口;否则在空白窗口打开 没有">""<"周围的引号。请保留所有其他引号。

答案 1 :(得分:0)

使用window.open

$onclick = "onclick=\"window.open(this.href,'New Account');return false;\"";
$output .= '<a target="_blank" href="/drupall/user/register"' . 
            $onclick . 'title="Create a new user account.">Create new account</a></li>';

答案 2 :(得分:0)

如果您想使用信息弹出,您可以这样做:

$text= 'Some thing to apear on the pop up!';

echo "<script>alert('".$text."')</script>";

如果你想要更多花哨弹出使用bootstrap模式:

http://getbootstrap.com/javascript/#modals

答案 3 :(得分:-2)

查看jQuery UI dialog

相关问题