you can use backticks `` // url params const elemA = "Los Angelis"; const elemB = "London"; window.location.href = `http://www.gorissen.info/Pierre/maps/googleMapLocation.php?lat=${elemA}&lon=${elemB}&setLatLon=Set`;