DataPackageView.GetHtmlFormatAsync | getHtmlFormatAsync method
Gets the HTML stored in the DataPackageView object.
Syntax
dataPackageView.getHtmlFormatAsync().done( /* Your success and error handlers */ );
Parameters
This method has no parameters.
Return value
Type: IAsyncOperation<String>
The HTML.
Remarks
Windows Phone 8
This API is not implemented and will throw an exception if called.
Examples
if (shareOperation.data.contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.html)) { document.getElementById("htmlContentArea").className = "unhidden"; shareOperation.data.getHtmlFormatAsync().then(function (html) { if (html !== null) { var htmlFragment = Windows.ApplicationModel.DataTransfer.HtmlFormatHelper.getStaticFragment(htmlFormat); // Set the innerHTML of the ifram to the HTML fragment. var iFrame = document.getElementById("htmlContent"); iFrame.style.display = ""; iFrame.contentDocument.documentElement.innerHTML = htmlFragment; } }); // Loop through any images and use the resourceMap to map each image element's src. var images = iFrame.contentDocument.documentElement.getElementsByTagName("img"); if (images.length > 0) { shareOperation.data.getResourceMapAsync().done(function (resourceMap) { if (resourceMap.size > 0) { for (var i = 0, len = images.length; i < len; i++) { var streamReference = resourceMap[images[i].getAttribute("src")]; if (streamReference) { // Call a helper function to map the image element's src to a corresponding blob URL generated from the streamReference setResourceMapURL(streamReference, images[i]); } } } }); } //shareOperation.reportCompleted();
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 2/25/2013
