开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜