Mercurial > urweb
comparison tests/updateErr.ur @ 729:7c6b6c3c7b79
Some client-side error handling
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 16 Apr 2009 13:47:20 -0400 |
parents | |
children | abb0e95dcaa1 |
comparison
equal
deleted
inserted
replaced
728:2197f0e24a9f | 729:7c6b6c3c7b79 |
---|---|
1 fun main () : transaction page = | |
2 s <- source ""; | |
3 b <- Buffer.create; | |
4 txt <- source ""; | |
5 | |
6 return <xml><body onload={onError (fn xml => Buffer.write b (show xml)); | |
7 onFail (fn s => alert ("FAIL! " ^ s))}> | |
8 <dyn signal={s <- signal s; return <xml>{[s]}</xml>}/><br/> | |
9 <dyn signal={s <- signal s; if s = "" then return <xml>Init</xml> else error <xml>Crapky</xml>}/><br/> | |
10 <dyn signal={s <- signal s; return <xml>"{[s]}"</xml>}/><br/> | |
11 | |
12 <ctextbox source={txt}/> <button onclick={s' <- get txt; set s s'; set txt ""}/> | |
13 | |
14 <hr/> | |
15 | |
16 <dyn signal={Buffer.render b}/> | |
17 </body></xml> |