What's the difference between following relative paths?
<script type="text/javascript" src="../Scripts/jquery-1.2.6.js"></script>
<script type="text/javascript" src="../../Scripts/jquery-1.2.6.js"></script>
<script type="text/javascript" src="/Scripts/jquery-1.2.6.js"></script>
<script type="text/javascript" src="~/Scripts/jquery-1.2.6.js"></script>
e.g. I have a web app names ASPWP1 and folder structure as follows
ASPWP1->Folder1
Please guide me in understanding relative paths.
Thanks in advance
The tilde (~) refers to HttpRuntime.AppDomainAppVirtualPath which is usually the route of the virtual directory.
Have you tested: < script type="text/javascript" src="~/Scripts/jquery-1.2.6.js">
I'm surprised it would actually reference the file without a runat="server" tag as JavaScript would not be able to determine the value of HttpRuntime.AppDomainAppVirtualPath.
I have included a MSDN source which you should read to help you understand this better.