Basically I want to have a button on my HTML/PHP page which will once clicked send a call to another php page which will update a value in mysql table.
<html>
<head>
<script>
src = "https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js">
function toggleText(button_id){
if(document.getElementById(button_id).innerHTML == "Uninstall All"){
document.getElementById(button_id).innerHTML = "Cancel Uninstall";
//ajax////////////////////
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "valueChange.php?uninstalled=1&type=all", true);
xmlhttp.send();
////////////////////////
}
}
</script>
</head>
I'm curious why this isn't working.
I had tested my toggleText function without the ajax and it changed the HTML properly.
But once I add in the ajax to visit this valueChange.php page and update an sql value it doesn't work.
I've tested the php page by itself and it properly updated the value in sql.
I've never used ajax so I'm curious if I'm doing it wrong? I thought my src = "google/ajax/jquery" was the way to install it. Or is there a library I need to install on the VPS hosting my site?