Created
March 29, 2010 11:00
-
-
Save tbje/347737 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def render = {<a onclick={Alert(Call(myFunction, 4, 5))}>Click me</a>} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.liftweb.http.js._ | |
import net.liftweb.http.js.JsCmds._ | |
import net.liftweb.http.js.JE._ | |
import net.liftweb.http.js.JE | |
... | |
val myFunction = "myFunction" | |
override lazy val fixedRender: Box[NodeSeq] = | |
Full( | |
<head> | |
<script>{ | |
Function(myFunction, List("arg1", "arg2"), | |
JsCrVar("myVar", JsVar("arg1") + JsVar("arg2")) & | |
JsReturn(JsVar("myVar")+10)} | |
</script> | |
</head> ++ <p>More fixed content comes here.</p>) | |
... | |
def render = {<a onclick={Call("alert", Call(myFunction, 4, 5))}>Click me</a>} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<script>function myFunction(arg1, arg2) { | |
var myVar = arg1 + arg2; | |
return myVar + 10 | |
} | |
</script> | |
<head> | |
... | |
<div ... ><div ...> | |
<a onclick="alert(myFunction(4,5))">Click me</a> | |
</div> | |
<p>More fixed content comes here.</p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment