首页 >后端开发 >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