Skip to content

Instantly share code, notes, and snippets.

@aurorapar
Created November 15, 2016 00:38
Show Gist options
  • Save aurorapar/b23ae1748ccb36052e05df6717d7d2e2 to your computer and use it in GitHub Desktop.
Save aurorapar/b23ae1748ccb36052e05df6717d7d2e2 to your computer and use it in GitHub Desktop.
var url = "http://localhost/lab8/php/driver.php";
window.onload = init;
function init()
{
$("#submitselect").click(submitQuery);
}
function submitQuery(event)
{
var country = $('#countryselect').val();
var city = $('#cityselect').val();
var population = $('#popselect').val();
var self = this;
$.ajax({
type: "POST",
url: url,
data: "country="+country+"&city="+city+"&population="+population,
success: function(response)
{
self.output = response;
}
});
$("#result").text("before");
alert(self.output);
$("#result").text(self.output);
alert("3");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment