JSFiddle - React, Tailwind, and code Playground
HTML
<button>click me</button>
<div class="result"></div>
JavaScript
$('button').click(function(){
$.ajax({
url: 'http://overestimated.info/script.php',
type: 'GET',
crossDomain: true,
dataType: 'json',
username: 'user',
password: 'user',
success: function(x, status){
$('.result').text(JSON.stringify(x));
},
error: function(x, status, error){
$('.result').text(status + ' - ' + error);
}
});
});