I want to redirect page after clicking an alert box "OK" button
This is my code, but this is not working. The alert box is coming up but when I press OK button it redirects to the same page. I want to redirect http://localhost/project/index.php/Con_Group_View this page.
else
{
echo '<script type="text/javascript">';
echo'alert("Your Group Already Created ");';
echo 'window.Location="http://localhost/project/index.php/Con_Group_View";';
echo '</script>';
}
You want window.location.href = "http://localhost/project/index.php/Con_Group_View" not window.Location. Remember, names are case-sensitive in javascript.
Also note this is a duplicate of How to redirect to another webpage in JavaScript/jQuery?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With