IHTMLScriptElement::src Property

Retrieves the URL to an external file that contains the source code or data.

Syntax

HRESULT IHTMLScriptElement::get_src(BSTR *p);
HRESULT IHTMLScriptElement::put_src(BSTR v);

Parameters

  • p
    Pointer to a variable of type BSTR that receives the URL of the source code or data.
  • v
    BSTR that specifies the URL of the source code or data.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

A script element can use the SRC attribute to refer to code stored in an external script library. If a script element refers to an external library and also contains code local to the block defined by the element, the code in the external library is executed before the local code.

In Microsoft Internet Explorer 5 and later , the SRC attribute of the script element can refer to an XML data set if the LANGUAGE attribute is set to XML.

The SRC attribute was first available in Internet Explorer 3.022. The src property is exposed through the object model as of Internet Explorer 4.0.