我有以下目录结构
*application
*media
*system
我将js文件放在media/js文件夹中,但是当我试图在视图中包含js文件时
<script type="text/javascript" src="media/js/common_functions.js"></script>
它会给出以下错误
Resource interpreted as Script but transferred with MIME type text/html
并且它不加载js文件..甚至jquery文件..有人能告诉我出了什么问题吗?我
可能重复:
如果jquery不加载,我如何设置备份?
我发现并尝试过这个:
if (typeof jQuery == 'undefined') {
alert('jquery didn't load !');
loadScript("/here/jquery.min.js");
.... // this is where i'd want to say load from '/here/jquery.js'
}
但我不知道如何在脚本中调用脚本的src。