changeset 644:8e17e6b615bd

Alert demo
author Adam Chlipala <adamc@hcoop.net>
date Tue, 10 Mar 2009 10:49:18 -0400
parents aa2290c32ce2
children 1b571a05874c
files demo/alert.ur demo/alert.urp demo/alert.urs demo/prose
diffstat 4 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/demo/alert.ur	Tue Mar 10 10:49:18 2009 -0400
@@ -0,0 +1,3 @@
+fun main () = return <xml><body>
+  <button value="Click me!" onclick={alert "You clicked me!"}/>
+</body></xml>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/demo/alert.urp	Tue Mar 10 10:49:18 2009 -0400
@@ -0,0 +1,2 @@
+
+alert
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/demo/alert.urs	Tue Mar 10 10:49:18 2009 -0400
@@ -0,0 +1,1 @@
+val main : unit -> transaction page
--- a/demo/prose	Tue Mar 10 10:44:26 2009 -0400
+++ b/demo/prose	Tue Mar 10 10:49:18 2009 -0400
@@ -185,3 +185,9 @@
 crud2.urp
 
 <p>This example shows another application of <tt>Crud.Make</tt>.  We mix one standard column with one customized column.  We write an underscore for the <tt>Inject</tt> field of meta-data, since the type class facility can infer that witness.</p>
+
+alert.urp
+
+<p>Ur/Web makes it easy to write code whose execution should be distributed between the web server and client web browsers.  Server-side code is compiled to efficient native code, and client-side code is compiled to JavaScript.  Ur/Web programmers don't need to worry about these details, because the language and standard library provide a uniform ML-like interface for the whole process.</p>
+
+<p>Here's an example of a button that, when clicked, opens an alert dialog on the client.</p>