Skip to content

Instantly share code, notes, and snippets.

@mads-hartmann
Created December 2, 2010 14:38
Show Gist options
  • Save mads-hartmann/725432 to your computer and use it in GitHub Desktop.
Save mads-hartmann/725432 to your computer and use it in GitHub Desktop.
Shows how to use JqAttr (Lift)
package sidewayscoding.example
// normal imports goes here
import net.liftweb.http.js.JE._ // implicit string => Str
import net.liftweb.http.js.JsCmds._ // implicit JsExp => JsCmd
import net.liftweb.http.js.jquery.JqJE.{JqId,JqAttr, Jq}
class Test {
def test =
"#test *" #> a( () => JqId("myid") ~> JqAttr("class","lolcat"), Text("clickme"))
}
<div class="lift:surround?with=default;at=content">
<div class="lift:Test.test">
<span id="myid">this will get changed</span>
<span id="test">link</span>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment