首頁 >後端開發 >php教程 >PHP动态输出JavaScript代码实例,phpjavascript_PHP教程

PHP动态输出JavaScript代码实例,phpjavascript_PHP教程

WBOY
WBOY原創
2016-07-13 10:06:59883瀏覽

PHP动态输出JavaScript代码实例,phpjavascript

直接上代码:

$url = $this->getConfig ()->url ();
$content = "var url={ base:'{$url->base}',css:'{$url->css}',js:'{$url->js}',img:'{$url->img}',current:window.location};";
$expire = 604800;
header ( 'Content-type: application/x-javascript' );
header ( 'Cache-Control: max-age=' . $expire );
header ( 'Accept-Ranges: bytes' );
header ( 'Content-Length: ' . strlen ( $content ) );
echo $content;

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/957125.htmlTechArticlePHP动态输出JavaScript代码实例,phpjavascript 直接上代码: $url = $this-getConfig ()-url ();$content = "var url={ base:'{$url-base}',css:'{$url-css}',js:'{$url-js}',i...
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn