<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body>
min <input type="number" min="0" max="999999" value="0" id="inp1"><br>
max <input type="number" min="0" max="999999" value="10" id="inp2"><br>
чисел <input type="number" min="0" max="100" value="1" id="inp3"><br>
<button>Кнопка</button>
<div id="text"></div>
<script>
$('button').click(function(){
var data = {
'jsonrpc': '2.0',
'method': 'generateIntegers',
'params': {
'apiKey': '00000000-0000-0000-0000-000000000000',
'n': inp3.value,
'min': inp1.value,
'max': inp2.value,
'replacement': true,
'base': 10
},
'id': 2601
};
$.ajax({
url: 'https://api.random.org/json-rpc/1/invoke',
type: "POST",
data: JSON.stringify(data),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(result) {
$('#text').html(result.result.random.data.toString());
}
});
});
</script>
</body>
</html>
вот трушный рандом, сгенерированный на основе атмосферного шума! преподу привет.