@ProviderType public final class Script extends AbstractNonSelfClosingHtmlElement<Script>
Script blocks are generated in a special XHTML conformant way, to work around some browser XHTML JavaScript problems:
<script type="text/javascript"> //<![CDATA[ script... //]]> </script>
| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE_JAVASCRIPT
Type "text/javascript".
|
| Constructor and Description |
|---|
Script()
Initializes html element.
|
Script(String script)
Initializes html element.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getSrc()
Html "src" attribute.
|
String |
getType()
Html "type" attribute.
|
Script |
setSrc(String value)
Html "src" attribute.
|
org.jdom2.Element |
setText(String script)
Sets the content of the element to be the text given.
|
Script |
setType(String value)
Html "type" attribute.
|
add, addCssClass, getCssClass, getData, getEmptyAttributeValueAsBoolean, getId, getStyle, getStyles, getStyleString, getTitle, setCssClass, setData, setEmptyAttributeValueAsBoolean, setId, setStyle, setStyleString, setTitlecreate, createAnchor, createAnchor, createAnchor, createAudio, createComment, createDiv, createFigCaption, createFigure, createImage, createImage, createImage, createImage, createImage, createNoScript, createScript, createScript, createSource, createSpan, createSpan, createVideoadd, addContent, addContent, addContent, addContent, addContent, getAttributeValueAsInteger, getAttributeValueAsLong, setAttribute, setAttribute, setAttributeValueAsInteger, setAttributeValueAsLong, setName, toString, toStringContentOnlyaddNamespaceDeclaration, canContainContent, clone, cloneContent, coalesceText, detach, getAdditionalNamespaces, getAttribute, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValue, getChild, getChild, getChildren, getChildren, getChildren, getChildText, getChildText, getChildTextNormalize, getChildTextNormalize, getChildTextTrim, getChildTextTrim, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getName, getNamespace, getNamespace, getNamespacePrefix, getNamespacesInherited, getNamespacesInScope, getNamespacesIntroduced, getNamespaceURI, getQualifiedName, getText, getTextNormalize, getTextTrim, getValue, getXMLBaseURI, hasAdditionalNamespaces, hasAttributes, indexOf, isAncestor, isRootElement, removeAttribute, removeAttribute, removeAttribute, removeChild, removeChild, removeChildren, removeChildren, removeContent, removeContent, removeContent, removeContent, removeNamespaceDeclaration, setAttribute, setAttributes, setContent, setContent, setContent, setContent, setNamespace, sortAttributes, sortChildren, sortContent, sortContentequals, getCType, getDocument, getParent, getParentElement, hashCode, setParentpublic static final String TYPE_JAVASCRIPT
public Script()
public Script(String script)
script - Script blockpublic String getType()
public Script setType(String value)
value - Value of attributepublic String getSrc()
public Script setSrc(String value)
value - Value of attributepublic org.jdom2.Element setText(String script)
Element.setContent(java.util.Collection<? extends org.jdom2.Content>) instead.
Setting a null text value is equivalent to setting an empty string value. Overrides standard setText method to add special xHTML conformant CDATA block
as workaround for browsers that does not interpret XHTML-encoded script blocks correctly.setText in class AbstractElement<Script>script - new text content for the elementCopyright © 2014–2017 wcm.io. All rights reserved.