Javascript Src Path

后端 未结 8 1251
被撕碎了的回忆
被撕碎了的回忆 2020-12-15 04:46

Hello I\'m having some trouble with the following code within my Index.html file:




        
相关标签:
8条回答
  • 2020-12-15 05:32

    As your clock.js is in the root, put your code as this to call your javascript in the index.html found in the folders you mentioned.

    <SCRIPT LANGUAGE="JavaScript" SRC="../clock.js"></SCRIPT>
    

    This will call the clock.js which you put in the root of your web site.

    0 讨论(0)
  • 2020-12-15 05:33

    Use an relative path to the root of your site, for example:

    If clock.js is on http://domain.com/javascript/clock.js

    Include :

    <script language="JavaScript" src="/javascript/clock.js"></script>
    

    If it's on your domain root directory:

    <script language="JavaScript" src="/clock.js"></script>
    
    0 讨论(0)
提交回复
热议问题