Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
| 2 <head> | |
| 3 <script> | |
| 4 | |
| 5 function state_changed(xhr) { | |
| 6 if (xhr.readyState == 4) { | |
| 7 window.location.href = "password_xhr_done.html"; | |
| 8 } | |
|
Ilya Sherman
2013/03/22 03:26:48
nit: Omit the curly braces?
| |
| 9 } | |
| 10 | |
| 11 function send_xhr() { | |
| 12 var xhr = new XMLHttpRequest(); | |
| 13 xhr.onreadystatechange = function() { state_changed(xhr); }; | |
| 14 xhr.open("GET", "password_xhr_submit.html", true); | |
| 15 xhr.send(null); | |
| 16 } | |
| 17 | |
| 18 </script> | |
| 19 </head> | |
| 20 <body> | |
| 21 <form action="password_xhr_submit.html" onsubmit="send_xhr(); return false;" | |
| 22 id="testform"> | |
| 23 <input type="text" id="username_field" name="username_field"> | |
| 24 <input type="password" id="password_field" name="password_field"> | |
| 25 <input type="submit" id="submit_button" name="submit_button"> | |
| 26 </form> | |
| 27 </body> | |
| 28 </html> | |
| OLD | NEW |