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.


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


  • 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.


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.


Minimum WinJS version

WinJS 1.0



See also


Loading HTML fragments sample (Windows)