I want to do the following without the need of jquery, this caught me generates a random word from the db and js calls it to the tag p
<div>
<form action="js/js.js" method="post" name="frm">
<input type="button" name="catga" value="new word" class="b" onclick="boton();">
</form>
</div>
<div id="dos"><p id="worda"></p></div>
the code js which shows me the word on the label p
function boton() {
$(document).ready(function() {
var pal="#worda";
$(pal).load("./php/php.php");
});
return false;
};
php code which chooses a word from the random db
include("conexion.php");
$codigo = mysql_query("SELECT * FROM categoria_a")or die(mysqli_error());
mt_srand(time());
$max = mysql_num_rows($codigo);
$rand = mt_rand(1,$max);
$obtener = mysql_query("SELECT * FROM categoria_a WHERE codigo_A='$rand'");
while($ban = mysql_fetch_array($obtener)) {
echo $ban['palabra_A']; }
is not to use jquery plis people, maybe jquery simplify it but not to be working with a heavy file plis