If you are calling this function through a submit button. This may be the reason why the browser does not redirect. It will run the code in the function and then submit the page instead of redirect. In this case change the type tag of your button.
More Related Contents:
- Is it possible to simulate key press events programmatically?
- How to simulate a mouse click using JavaScript?
- JavaScript click event listener on class
- onKeyPress Vs. onKeyUp and onKeyDown
- Trigger a keypress/keydown/keyup event in JS/jQuery?
- Document.write clears page
- How can I capture the right-click event in JavaScript? [duplicate]
- How can I trigger an onchange event manually? [duplicate]
- How do I capture response of form.submit
- Manipulating innerHTML removes the event handler of a child element? [duplicate]
- How does a function in a loop (which returns another function) work? [duplicate]
- How do you log all events fired by an element in jQuery?
- Javascript trick for ‘paste as plain text` in execCommand
- JavaScript mapping touch events to mouse events
- Capture click on div surrounding an iframe
- Using this inside an event handler
- Mozilla firefox not working with window.onbeforeunload
- Capturing load event on LINK
- Why can’t I reliably capture a mouseout event?
- Can multiple event listeners/handlers be added to the same element using Javascript?
- onchange event not fire when the change come from another function
- Looping through files for FileReader, output always contains last value from loop
- How to check whether a Button is clicked by using JavaScript
- event.clipboardData.setData in copy event
- event.target on Firefox
- Is it possible to catch browser’s File Open/Save dialog event using Javascript
- Is there a way to detect which side the Alt key was pressed on (right or left)?
- How to implement a lock in JavaScript
- Detecting support for a given JavaScript event?
- In web browsers, what’s the difference between onblur and onfocusout?