我有两个脚本加载到我的头部区域,它们是:
<script type="text/javascript">
var myDate = new Date();
var myStamp = ""+myDate.getDate()+myDate.getMonth()+myDate.getFullYear()+myDate.getHours()+myDate.getMinutes();
document.write('<script type="text/javascript" src="https://scriptlocation.com/js/script.js?' + myStamp + '"><\/script>');
</script>
<script type="text/javascript">
document.write('<script type="text/javascript" src=""https://scriptlocation.com/js/script2.js?'+SVNInfo.revision+'"><\/script>');
</script>
我的理想方案是将这两个合并到 1 个 javascript 文件中,因此我尝试创建一个包含以下内容的新文件:
var myDate = new Date();
var myStamp = ""+myDate.getDate()+myDate.getMonth()+myDate.getFullYear()+myDate.getHours()+myDate.getMinutes();
document.write('<script type="text/javascript" src="https://scriptlocation.com/js/script.js?' + myStamp + '"><\/script>');
document.write('<script type="text/javascript" src=""https://scriptlocation.com/js/script2.js?'+SVNInfo.revision+'"><\/script>');
但是,由于脚本未正确加载,这似乎不起作用。我是否需要重写/更改某些内容才能使其正常工作?
一些建议将不胜感激。