I have hosted a database MySQL
in a Byethost
free I need to call the register a name and number at random to generate a lottery.
With this code I can call my records in Javascript
now I need you to call me a number or name at random.
function leer() {
urltorequest = urlWS + "Usuario/leer";
$.ajax({
type: "get",
url: urltorequest,
async: false,
success: function (respuesta) {
toshow = JSON.parse(respuesta);
cabeceraTabla = "<table class=\"table table-condensed\"><thead><tr>
<th>ids</th><th>Nombre</th></tr></thead><tbody>";
pieTabla = "</tbody></table>";
contenidoTabla = "";
$(toshow).each(function (key, value) {
contenidoTabla = contenidoTabla + "<tr><td>" + value.idUsuario +
"</td><td>" + value.nombreUsuario + "</td></tr>";
});
document.getElementById("respuesta").innerHTML = cabeceraTabla +
contenidoTabla + pieTabla;
}
});
}