location = "http://studentboxoffice.in";
Window.location is a read-only Location object, you can also assign a
DOMString to it. This means that you can work with location as if it were a string in most cases:
location = 'http://www.example.com' is a synonym of
location.href = 'http://www.example.com'.
How the assign() and replace() differs
The difference between
assign() method, is that
replace() removes the URL of the current document from the document history, means it is not possible to use the "back" button to navigate back to the original web page. So Use the
assign() method if you want to load a new document, and want to give the option to navigate back to the original web page.
Navigate to a new page in jQuery:
let url = "http://studentboxoffice.in"; $(location).attr('href', url);
CreatedJan 17, 2020
UpdatedNov 03, 2020