@Artefact("TagLibrary") class JavascriptTagLib extends java.lang.Object
Tags for developing javascript and ajax applications.
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
INCLUDED_LIBRARIES |
Mappings to the relevant files to be included for each library. |
Type | Name and description |
---|---|
static java.lang.String |
CONTROLLER |
static java.lang.String |
INCLUDED_JS |
static java.lang.Object |
LIBRARY_MAPPINGS |
static java.lang.Object |
PROVIDER_MAPPINGS |
org.springframework.context.ApplicationContext |
applicationContext |
CodecLookup |
codecLookup |
java.lang.Class<JavascriptProvider> |
defaultProvider |
static java.lang.Object |
encodeAsForTags |
groovy.lang.Closure |
escapeJavascript Escapes a javascript string replacing single/double quotes and new lines. |
groovy.lang.Closure |
formRemote A form which uses the javascript provider to serialize its parameters and submit via an asynchronous ajax call. |
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 |
groovy.lang.Closure |
remoteField A field that sends its value to a remote link. |
groovy.lang.Closure |
remoteFunction Creates a remote function call. |
groovy.lang.Closure |
remoteLink Creates a link to a remote uri that can be invoked via ajax. |
groovy.lang.Closure |
setProvider |
groovy.lang.Closure |
submitToRemote Creates a form submit button that submits the current form to a remote ajax call. |
Constructor and description |
---|
JavascriptTagLib
() |
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() |
Mappings to the relevant files to be included for each library.
Escapes a javascript string replacing single/double quotes and new lines.
<g:escapeJavascript>This is some "text" to be escaped</g:escapeJavascript>
A form which uses the javascript provider to serialize its parameters and submit via an asynchronous ajax call.
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'
A field that sends its value to a remote link.
Creates a remote function call.
Creates a link to a remote uri that can be invoked via ajax.
Creates a form submit button that submits the current form to a remote ajax call.
Groovy Documentation