WinJS.Fragments.renderCopy function

Copies the contents of the specified Uniform Resource Identifier (URI) into the specified element.

Note Subsequent calls to renderCopy will reload the URI. No cached copy is maintained.

Syntax

WinJS.Fragments.renderCopy(href, target).done( /* Your success and error handlers */ );

Parameters

  • href
    Type: String

    The URI that contains the fragment to copy.

  • target
    Type: HTMLElement

    Optional. The element to which the fragment is appended.

Return value

Type: Promise**

A promise that is fulfilled when the fragment has been loaded. If a target element isn't specified, the rendered fragment is the completed value. The fragment is added to the cache. For a similar function where the fragment isn't added to the cache, see render.

Remarks

Cascading Style Sheets (CSS) and script blocks that are loaded from fragments are added to the document, and won't be removed even if the fragment is unloaded.

Requirements

Minimum WinJS version

WinJS 1.0

Namespace

WinJS.Fragments

See also

Samples

Loading HTML fragments sample (Windows)