Traj ciąg po - w jQuery
var str = "example.com/hello#item1".split('#')[0];
Ankur
var str = "example.com/hello#item1".split('#')[0];