Skip to content

Commit

Permalink
Draft complete "Around" chatper
Browse files Browse the repository at this point in the history
  • Loading branch information
d6y committed Feb 8, 2013
1 parent 05b76f9 commit 1157708
Show file tree
Hide file tree
Showing 2 changed files with 372 additions and 110 deletions.
13 changes: 7 additions & 6 deletions 05-JavaScript-Ajax-Comet.asciidoc
@@ -1,3 +1,4 @@
[[Ajax]]
Javascript, Ajax, Comet
-----------------------

Expand All @@ -22,7 +23,7 @@ import net.liftweb.http.SHtml
import net.liftweb.http.js.JsCmds
class MySnippet {
def easy = "#myButton [onclick]" #> SHtml.ajaxInvoke( () => {
println("click")
JsCmds.Alert("Hi")
Expand Down Expand Up @@ -102,7 +103,7 @@ that we're setting up this binding in our server-side Lift code:
[source,scala]
----
class HelloWorld {
def buttonBind =
def buttonBind =
"#button [onclick]" #> "$('#button').fadeOut('slow')"
}
----
Expand All @@ -121,7 +122,7 @@ Lift will render the page as:
[source,html]
----
<form>
<input onclick="$('#button').fadeOut('slow')"
<input onclick="$('#button').fadeOut('slow')"
value="Click me" type="button" id="button">
</form>
----
Expand All @@ -135,7 +136,7 @@ combine basic commands:

[source,scala]
----
def buttonBind =
def buttonBind =
"#button [onclick]" #> (
Alert("Here we go...") & RedirectTo("http://liftweb.net")
).toJsCmd
Expand All @@ -159,7 +160,7 @@ like this:

[source,scala]
----
def buttonBind =
def buttonBind =
"#button [onclick]" #> JE.Call("greet", "you").toJsCmd
----

Expand Down Expand Up @@ -277,7 +278,7 @@ on the page.

[source,scala]
----
package code.snippet
package code.snippet
import net.liftweb.util._
import Helpers._
Expand Down

0 comments on commit 1157708

Please sign in to comment.