Skip to content
Browse files

Add comments documenting the use of JsCmds.SetHtml.

This was prompted by a question on the mailing list about the difference between it and the Replace command. Hopefully the difference is more apparent now.
  • Loading branch information...
1 parent 78c38d3 commit 2ba72ac4e31300aaec1b3363ef115e8865b844cb @pr1001 pr1001 committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 web/webkit/src/main/scala/net/liftweb/http/js/JsCommands.scala
8 web/webkit/src/main/scala/net/liftweb/http/js/JsCommands.scala
@@ -707,6 +707,14 @@ object JsCmds {
+ /**
+ * Replaces the content of the node with the provided id with the markup given by content
+ *
+ * This is analogous to assigning a new value to a DOM object's innerHtml property in Javascript.
+ *
+ * @param id - the id of the node whose content will be replaced
+ * @param content - the new content
+ */
case class SetHtml(uid: String, content: NodeSeq) extends JsCmd {
// we want eager evaluation of the snippets so they get evaluated in context
val toJsCmd = LiftRules.jsArtifacts.setHtml(uid, Helpers.stripHead(content)).toJsCmd

0 comments on commit 2ba72ac

Please sign in to comment.
Something went wrong with that request. Please try again.