Any smart way of doing a \"root\" based path referencing in JavaScript, just the way we have ~/ in ASP.NET?
~/
I usually create a variable at the top of the js file and assign it the root path. Then I use that variable when referencing a file.
var rootPath = "/"; image.src = rootPath + "images/something.png";