Skip to content

Instantly share code, notes, and snippets.

@dudesl
Last active August 29, 2015 14:20
Show Gist options
  • Save dudesl/dae9bc0196190e5ea27f to your computer and use it in GitHub Desktop.
Save dudesl/dae9bc0196190e5ea27f to your computer and use it in GitHub Desktop.
def generateHtmlTag = { attrs->
def browser = request.getHeader("user-agent") ?: 'MSIE 7.0'
def cssClass = "no-js"
if(browser.contains('MSIE 7.0')){
cssClass = "no-js ie7"
}
else if(browser.contains('MSIE 8.0')){
cssClass = "no-js ie8"
}
else if(browser.contains('MSIE 9.0')){
cssClass = "no-js ie9"
}
else if(browser.contains('MSIE 10.0')){
cssClass = "no-js ie10"
}
else if(browser.contains('MSIE')){
cssClass = "no-js ie6"
}
out<<"""<html lang="${t9n.tr(s:'es-AR')}" class="${cssClass)}"> """
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment