public
Last active

  • Download Gist
gistfile1.scala
Scala
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
//lift version 2.3-M1
object ErrorSnippet extends DispatchSnippet {
val showBug = true
 
def dispatch = {
case _ => bug
}
 
def bug = {
val id = nextFuncName
 
def process() = {
JqJsCmds.AppendHtml(id, generateMarkup())
}
 
"*" #>
<div id={id}>
{SHtml.a(process _, Text("Update"))}
{generateMarkup()}
</div>
}
 
private def generateMarkup() =
if(showBug) {
<div><script type="text/javascript">{Unparsed("window.alert('works')")}</script>Buggy content</div>
} else {
<div>Simple content</div>
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.