Definitely the second method is preferred because you don’t have the overhead of another function invocation:
window.location.href = "https://stackoverflow.com/questions/4813879/webpage.htm";
More Related Contents:
- javascript show intro animation, then website
- Choosing and activating the right controls on an AJAX-driven site
- Get cookie by name
- How to pass parameters using ui-sref in ui-router to controller
- Callback after all asynchronous forEach callbacks are completed
- Why does a while loop block the event loop?
- How can I custom-format the Autocomplete plug-in results?
- (HTML) Download a PDF file instead of opening them in browser when clicked
- Merging or Combining two onEdit trigger functions
- Relation between CommonJS, AMD and RequireJS?
- Intercepting call to the back button in my AJAX application
- Proper use of const for defining functions
- Why do I need to copy an array to use a method on it?
- JavaScript string with new line – but not using \n
- setTimeout() inside JavaScript Class using “this”
- javascript change background color on click [closed]
- Why do I have to .bind(this) for methods defined in React component class, but not in regular ES6 class
- Phone mask with jQuery and Masked Input Plugin
- How can I hide or encrypt JavaScript code? [duplicate]
- How to disable (View Source) and (Ctrl + C ) from my site
- Why should use “apply”?
- Encoding UTF-8 when exporting HTML table to Excel
- How to disable editing for some cells in row editing of JQGrid?
- Can I wrap each line of multi-line text in a span?
- What are JavaScript’s builtin strings?
- getting the last item in a javascript object
- image.onError event never fires, but image isn’t valid data – need a work around
- Refresh iFrame (Cache Issue)
- React’s setState method with prevState argument
- jQuery InnerText not including sub element