What is the difference between / and ~/ relative paths?

我的未来我决定 提交于 2019-12-06 08:31:35

/ will take you back to the root of your website.

~/ will take you to the home folder of your application on the website.

If your application is in a folder called myApp, for example, so the URL looks like this

http://www.YourSite.com/myApp/ 

and in your application you use ~/Scripts/jquery.js then the path referenced will be

http://www.YourSite.com/myApp/Scripts/jquery.js

whereas just using / would send you all the way back to the root of the website

http://www.YourSite.com/Scripts/jquery.js
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!