Release 1.0.5.
[csrf-magic.git] / js-test / prototype.php
bloba0e7738a094b05fb95f29fa42faa4d6a3bbfed42
1 <?php require_once 'common.php'; ?>
2 <!DOCTYPE html
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6 <head>
7 <title>Prototype test page for csrf-magic</title>
8 <?php $loc = print_javascript('prototype', 'https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js') ?>
9 </head>
10 <body>
11 <h1>Prototype test page for csrf-magic</h1>
12 <p>Using <?php echo $loc ?></p>
13 <textarea id="js-output" cols="80" rows="4"></textarea>
14 <script type="text/javascript">
15 //<![CDATA[
16 var textarea = document.getElementById('js-output');
17 textarea.value = "Prototype " + Prototype.Version + ":\n";
18 var callback = function (transport) {
19 textarea.value += transport.responseText;
21 new Ajax.Request('prototype.php',
23 parameters: {
24 ajax: 'yes',
25 foo: 'bar'
27 onSuccess: callback
28 });
29 new Ajax.Request('prototype.php',
31 parameters: 'ajax=yes&foo=bar',
32 onSuccess: callback
33 });
34 //]]>
35 </script>
36 </body>
37 </html>