IHTMLIFrameElement3::src Property

Sets or retrieves a URL to be loaded by the object.

Syntax


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

Parameters

p
Pointer to a variable of type BSTR that receives the URL.
v
BSTR that specifies the URL.

Return Value

Returns S_OK if successful, or an error value otherwise.

Example

This example uses the IHTMLIFrameElement3::src property to change the IHTMLIFrameElement3::src attribute of an iframe.



function changeFrame(){
  alert (document.all.iframe1.src);
  document.all.iframe1.src="http://www.microsoft.com/";
  alert (document.all.iframe1.src);
}

Community Additions

Show: