获取javascript文件路径

时间:2016-07-18 13:41:55

标签: javascript jquery path filepath

在我的HTML代码中:

<head>
<script type = "text/javascript" src = "elements/effects/my_js_code.js"></script>
</head>

在elements / effects / js / my_js_code.js中:

function ($) { $('head').append("<link type = 'text/css' rel =
'stylesheet' href = 'elements/effects/css/my_js_code.css'>"); /* more
code */ }

如何从my_js_code.js中检测my_js_code.js的完整路径?

function ($) { $('head').append("<link type = 'text/css' rel =
'stylesheet' href = '" + MY_FUNC_CALCULATE_PATH("../css/my_js_code.css") + "'>"); /* more
code */ }

0 个答案:

没有答案