【问题标题】:PHP: Open New Window?PHP:打开新窗口?
【发布时间】:2022-05-13 06:19:32
【问题描述】:

我知道 JavaScript 是客户端而 PHP 是服务器端,在下面的代码中,我是否可以弹出一个新窗口或调用弹出一个新窗口? echo 语句不起作用。任何想法都非常感谢。

<?php 

class testpop__class 
{ 
    function testpop__method(&$bean, $event, $arguments=null) 
    { 
        if ($event != 'before_save') return; 
        // Insert your custom logic between these comments 

        // Insert your custom logic between these comments 
    } 
} 
?>

【问题讨论】:

  • 为什么 echo 语句不起作用?

标签: javascript php


【解决方案1】:

严格使用 PHP,不。但是,如果你使用 ECHO 输出 javascript,你可以让 javascript 打开一个新窗口。

【讨论】:

    【解决方案2】:

    您可以使用 echo 打印出一些 javascript。像这样

    echo "<script type='javascript'>window.showModalDialog('webpage.php')</script>";
    

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-03-24
      • 2014-11-21
      • 1970-01-01
      • 2013-02-09
      • 2019-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多