|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gargoylesoftware.htmlunit.html.DomNode
com.gargoylesoftware.htmlunit.html.DomNamespaceNode
com.gargoylesoftware.htmlunit.html.DomElement
com.gargoylesoftware.htmlunit.html.HtmlElement
com.gargoylesoftware.htmlunit.html.HtmlScript
public class HtmlScript
Wrapper for the html element "script".
When a script tag references an external script (with attribute src) it gets executed when the node
is added to the DOM tree. When the script code is nested, it gets executed when the text node
containing the script is added to the HtmlScript.
The ScriptFilter feature of NekoHtml can't be used because it doesn't allow immediate access to the DOM
(i.e. document.write("<span id='mySpan'/>"); document.getElementById("mySpan").tagName;
can't work with a filter).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement |
---|
HtmlElement.ChildElementsIterator, HtmlElement.MapEntryWrappingIterator |
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.DomNode |
---|
DomNode.ChildIterator, DomNode.DescendantElementsIterator |
Field Summary | |
---|---|
static String |
TAG_NAME
The HTML tag represented by this element. |
Fields inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement |
---|
ATTRIBUTE_NOT_DEFINED, ATTRIBUTE_VALUE_EMPTY, TAB_INDEX_OUT_OF_BOUNDS |
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode |
---|
ATTRIBUTE_NODE, COMMENT_NODE, DOCUMENT_NODE, ELEMENT_NODE, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED, TEXT_NODE |
Constructor Summary | |
---|---|
HtmlScript(HtmlPage page,
Map attributes)
Deprecated. You should not directly construct HtmlScript. |
Method Summary | |
---|---|
DomNode |
appendDomChild(DomNode node)
Executes the content as a script if said content is a text node. |
String |
asText()
Returns a text representation of this element that represents what would be visible to the user if this page was shown in a web browser. |
String |
getCharsetAttribute()
Return the value of the attribute "charset". |
String |
getDeferAttribute()
Return the value of the attribute "defer". |
String |
getEventAttribute()
Return the value of the attribute "event". |
String |
getHtmlForAttribute()
Return the value of the attribute "for". |
String |
getLanguageAttribute()
Return the value of the attribute "language". |
String |
getSrcAttribute()
Return the value of the attribute "src". |
String |
getTypeAttribute()
Return the value of the attribute "type". |
protected boolean |
isEmptyXmlTagExpanded()
Indicates if a node without children should be written in expanded form as xml (i.e. |
protected void |
onAddedToPage()
Executes the onreadystatechange handler when simulating IE, as well as executing the script itself, if necessary. |
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNamespaceNode |
---|
getLocalName, getNamespaceURI, getPrefix, getQualifiedName, setPrefix |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String TAG_NAME
Constructor Detail |
---|
public HtmlScript(HtmlPage page, Map attributes)
page
- The HtmlPage that contains this element.attributes
- the initial attributesMethod Detail |
---|
public final String getCharsetAttribute()
public final String getTypeAttribute()
public final String getLanguageAttribute()
public final String getSrcAttribute()
public final String getEventAttribute()
public final String getHtmlForAttribute()
public final String getDeferAttribute()
public DomNode appendDomChild(DomNode node)
appendDomChild
in class DomNode
node
- the node to append
protected void onAddedToPage()
onAddedToPage
in class DomNode
public String asText()
DomNode
asText
in class DomNode
HtmlInput.asText()
protected boolean isEmptyXmlTagExpanded()
isEmptyXmlTagExpanded
in class HtmlElement
true
to make generated xml readable as html
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |