JavaScript function which provides URL info