modify fixed hostname to dynamic in javascript.