use routing for building urls in JavaScript