Any smart way of doing a \"root\" based path referencing in JavaScript, just the way we have ~/ in ASP.NET?
~/
Use base tag:
...
from now any link use on this page, no matter in javascript or html, will be relative to the base tag, which is "http://www.example.com/myapp/".