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