Sha256: f074757da67d025e77659c5794240156895f952a4043231167aa6f0eac594f34
Contents?: true
Size: 1.04 KB
Versions: 15
Compression:
Stored size: 1.04 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>
Version data entries
15 entries across 15 versions & 2 rubygems