Fixing site.baseurl in javascript