
This interface specifies a script for the page that will be interpreted by a script engine.
Code within the SCRIPT block that is not contained within a function is executed immediately as the page is loaded. To keep scripts from being displayed on down-level browsers, the SCRIPT block should be nested within a comment block.
This element is a block element.
IHTMLScriptElement Methods
| put_src | get_src | put_htmlFor |
| get_htmlFor | put_event | get_event |
| put_text | get_text | put_defer |
| get_defer | get_readyState | put_onerror |
| get_onerror | put_type | get_type |
HRESULT put_src(
BSTR v
);
Specifies an external file that contains the source code.
A script can contain an external reference as well as code within the block. The code specified by src precedes the code contained within the document.
See also get_src
HRESULT get_src(
BSTR *p
);
Retrieves an external file that contains the source code.
A script can contain an external reference as well as code within the block. The code specified by src --> precedes the code contained within the document.
See also put_src
HRESULT put_htmlFor(
BSTR v
);
Sets which element is being bound to the event script. This htmlFor property corresponds to the HTML FOR= attribute.
For more information on inline script, see Attaching an Event Handler in the Event Model documantation.
See also get_htmlFor
HRESULT get_htmlFor(
BSTR *p
);
Retrieves which element is being bound to the event script. This htmlFor property corresponds to the HTML FOR= attribute.
For more information on inline script, see Attaching an Event Handler in the Event Model documantation.
See also put_htmlFor
HRESULT put_event(
BSTR v
);
Sets the event for which the script is being written.
See also get_event
HRESULT get_event(
BSTR *p
);
Retrieves the event for which the script is being written.
See also put_event
HRESULT put_text(
BSTR v
);
Retrieves the text contained within the SCRIPT element.
See also get_text
HRESULT get_text(
BSTR *p
);
Retrieves the text contained within the SCRIPT element.
See also put_text
HRESULT put_defer(
VARIANT_BOOL v
);
Sets the Boolean value indicating whether this script's execution is deferred until the document completes loading.
See also get_defer
HRESULT get_defer(
VARIANT_BOOL *p
);
Retrieves the Boolean value indicating whether this script's execution is deferred until the document completes loading.
See also put_defer
HRESULT get_readyState(
BSTR *p
);
Retrieves the current state of an object being downloaded.
| complete | The object is completely loaded. |
| interactive | The object can be interacted with even though it is not fully loaded. |
| loading | The object is currently being loaded. |
| unitialized | The object is not created. Usually when the object is being downloaded. |
Each object can independently determine which of the states it exposes.
HRESULT put_onerror(
VARIANT v
);
Sets the inline script associated with the onerror event on the script element.
For more information on inline script, see Attaching an Event Handler in the Event Model documentation.
See also get_onerror
HRESULT get_onerror(
VARIANT *p
);
Retrieves the inline script associated with the onerror event on the script element.
For more information on inline script, see Attaching an Event Handler in the Event Model documentation.
See also put_onerror
HRESULT put_type(
BSTR v
);
Indicates the type script of the scripting language as a string for the IHTMLScriptElement object. The contents of this script is read only, and can be modified only at design time.
See also get_type
HRESULT get_type(
BSTR *p
);
Retrieves the string that represents the language that the current script was written in. The default language is JScript.
| JScript | Specifies that the script is written in JScript. |
| Jscript | Specifies the language as JScript. |
| vbs | Specifies the language as VBScript. |
| vbscript | Specifies that the script is written in VBScript. |
This is an HTML 4.0 attribute and is equivalent to the language property.
See also put_type
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.