开发者

link to external javascript file in a subdirectory from a web host

开发者 https://www.devze.com 2023-01-18 04:34 出处:网络
I have my index.html at the 开发者_如何学运维root of my web host, and my javascript file is in a directory(JavaScript) which is also at the root. How can I link my index to the js file? I did the foll

I have my index.html at the 开发者_如何学运维root of my web host, and my javascript file is in a directory(JavaScript) which is also at the root. How can I link my index to the js file? I did the following, but it's not working: <script type="text/javascript" src="JavaScript/filename.js"></script> in the head. It works when I do the inline javascript


<script type="text/javascript" src="JavaScript/file.js"></script>

Loads the file.js in the subdirectory "JavaScript". It'll work unless a base href is specified.

Edit: I see now that's pretty much what you had. Should work. You got full code or URL?

0

精彩评论

暂无评论...
验证码 换一张
取 消