Difference between revisions of "MediaWiki:Common.js"
From SaWikiLeaks
| Line 1: | Line 1: | ||
| − | |||
| − | |||
$(function () { | $(function () { | ||
$.ajax({ | $.ajax({ | ||
| Line 22: | Line 20: | ||
}); | }); | ||
}()); | }()); | ||
| − | |||
| − | |||
Latest revision as of 13:33, 9 May 2017
$(function () {
$.ajax({
type: "GET",
url: 'http://sawikileaks.org/extra/lunchalgo.php',
dataType: 'json',
success: function(jsondata){
console.log(jsondata.choices);
$('#lunch-choices').html(jsondata.choices);
}
});
$('#btn-random').click(function() {
$.ajax({
type: "GET",
url: 'http://sawikileaks.org/extra/lunchalgo.php',
dataType: 'json',
success: function(jsondata){
$('#lunch-random').html(jsondata.percentages + '<br/>' + jsondata.choice);
}
});
});
}());