Solucio multiplicar
De wikiserver
//USANT $.POST
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
<head>
<title>Taula de multiplicar amb jQuery - AJAX</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("select").change(function(){
//alert($("select").val());
valor = $("select").val();
$.post("calcular_taula.php",
{
value:valor
},
function(data,status){
//alert("Data: " + data + "\nStatus: " + status);
$("#resultat").html(data);
});
});
});
</script>
<meta http-equiv="content-type" content="text/html charset=utf-8" />
</head>
<body>
<h2>Selecciona una taula de multiplicar</h2>
<div id="taula">
<select name="taula">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</div>
<div id="resultat">
</div>
</body>
</html>
//fitxer php
<?php
$valor = $_POST["value"];
//echo $valor;
for ($i = 1; $i <= 10; $i++) {
echo $valor. " * ".$i." = ".$valor*$i."<br />\n";
}
?>