开发者

Help with directories

开发者 https://www.devze.com 2023-02-14 04:34 出处:网络
I am running a java script in an .htm file located at /Dir1/Dir2/Dir3/testing.ht开发者_如何学Gom. Where it says script src=\" \" What would I put in the quotations to have it read from my file located

I am running a java script in an .htm file located at /Dir1/Dir2/Dir3/testing.ht开发者_如何学Gom. Where it says script src=" " What would I put in the quotations to have it read from my file located at /Dir1/Test1/example.txt

Thanks


You can put: /Dir1/Test1/example.txt

The slash at the beginning tells the browser use the base directory as a point of reference when looking for files.

You can also do ../../Test1/example.txt which will look at the directory structure relative to your testing.htm file location.


Or relative: ../../Test1/example.txt

0

精彩评论

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