Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | daniel-mar | 1 | <cfinclude template="sajax.cfm"> |
2 | <cfscript> |
||
3 | function multiply(x, y) { |
||
4 | return x * y; |
||
5 | } |
||
6 | |||
7 | // sajax_debug_mode = true; |
||
8 | sajax_failure_redirect = "http://sajax.info/sajaxfail.html"; |
||
9 | sajax_export("multiply"); |
||
10 | sajax_handle_client_request(); |
||
11 | |||
12 | </cfscript> |
||
13 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
||
14 | <html xmlns="http://www.w3.org/1999/xhtml"> |
||
15 | <head> |
||
16 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
||
17 | <title>Sajax Multiplier example</title> |
||
18 | <script type="text/javascript" src="json2.stringify.js"></script> |
||
19 | <script type="text/javascript" src="json_stringify.js"></script> |
||
20 | <script type="text/javascript" src="json_parse_state.js"></script> |
||
21 | <script type="text/javascript" src="sajax.js"></script> |
||
22 | <script type="text/javascript"><!-- |
||
23 | <cfscript>sajax_show_javascript();</cfscript> |
||
24 | |||
25 | function do_multiply_cb(z) { |
||
26 | document.getElementById("z").value = z; |
||
27 | } |
||
28 | |||
29 | function do_multiply() { |
||
30 | // get the folder name |
||
31 | var x, y; |
||
32 | |||
33 | x = parseFloat(document.getElementById("x").value); |
||
34 | y = parseFloat(document.getElementById("y").value); |
||
35 | x_multiply(x, y, do_multiply_cb); |
||
36 | } |
||
37 | //--> |
||
38 | </script> |
||
39 | </head> |
||
40 | <body> |
||
41 | <input type="text" name="x" id="x" value="2" size="3" /> |
||
42 | * |
||
43 | <input type="text" name="y" id="y" value="3" size="3" /> |
||
44 | = |
||
45 | <input type="text" name="z" id="z" value="" size="3" /> |
||
46 | <input type="button" name="check" value="Calculate" onclick="do_multiply(); return false;" /> |
||
47 | </body> |
||
48 | </html> |