JavascriptTagLib (Grails 3.2.4)
Date: 2016-12-21

Package: org.grails.plugins.web.taglib

## [Groovy] Class JavascriptTagLib

- org.grails.plugins.web.taglib.JavascriptTagLib

- All Implemented Interfaces and Traits:
    org.springframework.context.ApplicationContextAware, TagLibrary

      @TagLib
      class JavascriptTagLib
      extends java.lang.Object

  Javascript tags.

  Authors:
    Graeme Rocher

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `org.springframework.context.ApplicationContext` | `applicationContext`
    `static java.lang.Object` | `encodeAsForTags`
    `groovy.lang.Closure` | `escapeJavascript` Escapes a javascript string replacing single/double quotes and new lines.
    `boolean` | `hasResourceProcessor`
    `groovy.lang.Closure` | `javascript` Includes a javascript src file, library or inline script if the tag has no 'src' or 'library' attributes its assumed to be an inline script:
    `GrailsPluginManager` | `pluginManager`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Property Detail

    - #### org.springframework.context.ApplicationContext applicationContext

    - #### static java.lang.Object encodeAsForTags

    - #### groovy.lang.Closure escapeJavascript

      Escapes a javascript string replacing single/double quotes and new lines.
      <g:escapeJavascript>This is some "text" to be escaped</g:escapeJavascript>

    - #### boolean hasResourceProcessor

    - #### groovy.lang.Closure javascript

      Includes a javascript src file, library or inline script if the tag has no 'src' or 'library' attributes its assumed to be an inline script:
      <g:javascript>alert('hello')</g:javascript>
      The 'library' attribute will attempt to use the library mappings defined above to import the right js files and not duplicate imports eg.
      <g:javascript library="scriptaculous" /> // imports all the necessary js for the scriptaculous library
      The 'src' attribute will merely import the js file but within the right context (ie inside the /js/ directory of the Grails application:
      <g:javascript src="myscript.js" /> // actually imports '/app/js/myscript.js'

      attr:
        src The name of the javascript file to import. Will look in web-app/js dir
      attr:
        library The name of the library to include. e.g. "jquery", "prototype", "scriptaculous", "yahoo" or "dojo"
      attr:
        plugin The plugin to look for the javascript in
      attr:
        contextPath the context path to use (relative to the application context path). Defaults to "" or path to the plugin for a plugin view or template.
      attr:
        base specifies the full base url to prepend to the library name

    - #### GrailsPluginManager pluginManager