get base url using jquery code example Example: jquery get base url console.log(window.location.origin);