JS实现动态引用文件
<script>//******************************************************
// 包含文件 用法: $import('../include/mian.js', 'js');
// $import('../style/style.css', 'css');
//******************************************************
function $import(path, type)
{
if (type == "css")
{
document.write("<" + "link href=\"" + path + "\" rel=\"stylesheet\" type=\"text/css\"></" + "link>");
} else
{
document.write("<" + "script src=\"" +path + "\"></" + "script>");
}
}
</script>
页:
[1]