Home > Backend Development > PHP Tutorial > PHP dynamic output JavaScript code example, phpjavascript_PHP tutorial

PHP dynamic output JavaScript code example, phpjavascript_PHP tutorial

WBOY
Release: 2016-07-13 10:06:59
Original
877 people have browsed it

PHP dynamic output JavaScript code example, phpjavascript

Go directly to the code:

$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;
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/957125.htmlTechArticlePHP dynamic output JavaScript code example, phpjavascript directly enters the code: $url = $this-getConfig ()-url ( );$content = "var url={ base:'{$url-base}',css:'{$url-css}',js:'{$url-js}',i...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template