Share via


create method

Creates a new XMLHttpRequest object.

Syntax

HRESULT retVal = object.create(p);

Parameters

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

IHTMLXMLHttpRequestFactory::create was introduced in Windows Internet Explorer 7.

Examples

This method is called when the factory object is invoked with DISPID DISPATCH_CONSTRUCT in order to create and return an object supporting the IHTMLXMLHttpRequest interface. The actual method invocation is done implicitly when the "new" syntax is used or explicitly by calling it on the factory object. The following example demonstrates how this might be accomplished in script:

// Implicit create, with new
oXMLHttpRequest = new XMLHttpRequest();

// Explicit create, with factory object
factoryObj = window.XMLHttpRequest;
oXMLHttpRequest = factoryObj.create();

See also

XMLHttpRequest