Sha256: 1b020eafe32d3cb65be58c649757c8494151449d484bd02b56ebc0e304dd02dc
Contents?: true
Size: 1.05 KB
Versions: 51
Compression:
Stored size: 1.05 KB
Contents
<htmL> <head> <title>Prototype - Sample App</title> <script type="application/x-javascript" src="/prototype-1.6.0.3.js"></script> </head> <body> <div id="ajax-demo"> <h2>AJAX Calculator</h2> <form id="calculator-form" action="#" method="post" onSubmit="return false;"> <input id="calculator-expression" name="calculator-expression"/> <input type="submit" id="calculator-button" value="Compute" /> <br/><br/> <div>Result: <input id="calculator-result" disabled /></div> </form> <script type="text/javascript" language="javascript"> Event.observe(window, 'load', function() { Event.observe('calculator-button', 'click', function (event) { new Ajax.Request('/compute', { method: 'post', parameters: $('calculator-form').serialize(true), onSuccess: function(transport) { $('calculator-result').value = transport.responseText; }, }); return false; }); }); </script> </div> </body> </html>
Version data entries
51 entries across 51 versions & 4 rubygems