Mercurial > urweb
annotate tests/cookie.ur @ 2119:5439b35c5d0b
Add 'download' attribute to <a/>, part of HTML5
author | Sergey Mironov <grrwlf@gmail.com> |
---|---|
date | Sun, 26 Oct 2014 14:07:07 +0000 |
parents | 1626dcba13ee |
children |
rev | line source |
---|---|
adamc@459 | 1 cookie c : string |
adamc@459 | 2 |
adamc@466 | 3 fun other () = |
adamc@463 | 4 so <- getCookie c; |
adamc@459 | 5 case so of |
adamc@459 | 6 None => return <xml>No cookie</xml> |
adamc@459 | 7 | Some s => return <xml>Cookie: {[s]}</xml> |
adamc@466 | 8 |
adamc@466 | 9 structure M = struct |
adamc@466 | 10 fun aux () = |
adamc@466 | 11 setCookie c "Hi"; |
adamc@466 | 12 so <- getCookie c; |
adamc@466 | 13 case so of |
adamc@466 | 14 None => return <xml>No cookie</xml> |
adamc@466 | 15 | Some s => return <xml><body>Cookie: {[s]}<br/> |
adamc@466 | 16 <a link={other ()}>Other</a></body></xml> |
adamc@466 | 17 end |
adamc@466 | 18 |
adamc@466 | 19 fun main () : transaction page = return <xml><body> |
adamc@466 | 20 <a link={other ()}>Other</a><br/> |
adamc@466 | 21 <a link={M.aux ()}>Aux</a><br/> |
adamc@466 | 22 </body></xml> |