zAjaxFrame
Auteur: zamna - 20 januari 2007 - 15:04 - Gekeurd door: Joel - Hits: 3893 - Aantal punten: 3.50 (1 stem)
|
Code: |
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>zAjaxFrame voorbeeld</title>
<script type="text/javascript" src="../../zAjaxFrame.js"></script>
<script type="text/javascript">
function som() {
var namen = new Array("getal1", "getal2");
var waarden = new Array(document.getElementById('txtGetal1').value, document.getElementById('txtGetal2').value);
makeGetRequest('verwerk.php', namen, waarden, 'toonsom');
}
function toonsom(responsewaarde) {
document.getElementById('txtResultaat').innerHTML = "De som is " + responsewaarde + ".";
}
</script>
</head>
<body>
<form style="margin: 0;">
<input type="text" name="txtGetal1" id="txtGetal1" />
<input type="text" name="txtGetal2" id="txtGetal2" />
<input type="button" name="btnVerwerk" id="btnVerwerk" value="Tel op" />
</form>
<br />
<div id="txtResultaat" style="background-color: #990000; color: #FFFFFF; width: 360px;">
Hier komt de som.
</div>
<script type="text/javascript">
addEvent(document.getElementById('btnVerwerk'), 'click', som);
</script>
</body>
</html>
<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>zAjaxFrame voorbeeld</title> <script type="text/javascript" src="../../zAjaxFrame.js"></script> <script type="text/javascript"> function som() { var namen = new Array("getal1", "getal2"); var waarden = new Array(document .getElementById ('txtGetal1').value , document .getElementById ('txtGetal2').value ); makeGetRequest('verwerk.php', namen, waarden, 'toonsom'); } function toonsom(responsewaarde) { document.getElementById('txtResultaat').innerHTML = "De som is " + responsewaarde + "."; } </script> </head> <body> <form style="margin: 0;"> <input type="text" name="txtGetal1" id="txtGetal1" /> <input type="text" name="txtGetal2" id="txtGetal2" /> <input type="button" name="btnVerwerk" id="btnVerwerk" value="Tel op" /> </form> <br /> <div id="txtResultaat" style="background-color: #990000; color: #FFFFFF; width: 360px;"> Hier komt de som. </div> <script type="text/javascript"> addEvent(document.getElementById('btnVerwerk'), 'click', som); </script> </body> </html>
Download code (.txt)
|
|
|
Stemmen |
Niet ingelogd. |
|