Here is my HTML button:
<button class="button-brightgreen" onclick="cancelbutton();">Cancel</button>
Here is my JavaScript redirect:
function cancelbutton() {
var cancelURL = 'http://localhost:51937/php/searchUsers.php';
$(location).attr('href', cancelURL);
}
This is on my editUser.php page. This code works fine for me, except when there is a php GET string in the current URL such as ?user_id=19
When there is a GET in the URL and I click the cancel button, it takes me back to the same page (editUser.php) and displays ""
How can I get the redirect to work when there is a GET in the current URL?
javascript: window.history = "http://localhost:51937/php/searchUsers.php";