Last active
September 5, 2019 19:55
-
-
Save pavelzag/0a73fe817aed1d2981db30e53693d6b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$("button").click(function() { | |
var xhr = new XMLHttpRequest(); | |
var url = "http://localhost:8081/trigger_jenkins_job"; | |
var selectedCity = $('#city').val(); | |
xhr.open("POST", url, true); | |
xhr.setRequestHeader("Content-Type", "application/json"); | |
xhr.onreadystatechange = function() { | |
if (xhr.readyState === 4 && xhr.status === 200) { | |
var json = JSON.parse(xhr.responseText); | |
} | |
}; | |
var data = JSON.stringify({ | |
"city_name": selectedCity | |
}); | |
xhr.send(data); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment