I am trying to send a user to another page using a Javascript Function:
<
window.location.href = url;
It is ok for redirecting to the required url using javascript.
The simple example can be found in this url