showMessage方法

 /**
     * Alert show message
     * @param string $message
     * @param string $mode 跳转地址
     * @return void
     */
    function showMessage($message, $mode = "back")
    {
        ob_start();
        if($mode == "back")
        {
            $cmd = "history.go(-1)";
        }
        else
        {
            $cmd = "location.href = '" . $mode . "';";
        }

        echo '<script language="javascript">
        <!--
            alert("' . $message . '");' . $cmd . '
        -->
            </script>';

        ob_end_flush();
        exit();
    }

mmy123456
376 声望17 粉丝

有项目请联系:15201970281(毛毛)