a util for dealing with url in javascript