摘要:
<?php/*$src = 'js/myjs.js';$out = 'js/myjs.min.js';require 'class.JavaScriptPacker.php';$script = file_get_contents($src);$t1 = microtime(true);$packer = new JavaScriptPacker($script, 'Normal', true, false);$packed = $packer->pack();$t2 = microtime(true);$time = 阅读全文
摘要:
css和js带参数(形如.css?v=与.js?v=)<script type=”text/javascript” src=”jb51.js?version=1.2.6″></script><link rel=’stylesheet’ href=’base.css?version=2.3.3′ type=’text/css’ />使用参数有两种可能,第一、脚本并不存在,而是服务端动态生成的,因此带了个版本号,以示区别。 即上面代码对于文件来说等价于<script type=”text/javascript” src=”jb51.js”></ 阅读全文