Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
//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>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.