다음을 통해 공유


HTML and DOM API changes list (HTML)

[ This article is for Windows 8.x and Windows Phone 8.x developers writing Windows Runtime apps. If you’re developing for Windows 10, see the latest documentation ]

Windows Runtime apps using JavaScript use Windows Internet Explorer Standards mode when processing most of their HTML and JavaScript, but there are some HTML and DOM APIs that work differently or aren't supported. Here's the list of the HTML and DOM APIs that behave differently or aren't supported for Windows Runtime apps using JavaScript.

When writing code for web sites and Windows apps using JavaScript, you can use feature detection to determine whether an API is supported before you use it. For more info, see Same Markup: Writing Cross-Browser Code.

API Description

a.target

Behavior change. Cannot be used to open a new window inside the app. If you try to open an external web page in a new window (such as by setting target = "_blank") the link opens in the browser instead.

a.uri

Not supported.

addBehavior

Not supported.

body.behaviorUrns

Not supported.

body.removeBehavior

Not supported.

body.scopeName

Not supported.

body.tagUrn

Not supported.

document.execCommand

Behavior change. The createLink and insertImage commands don't create a UI. The saveAs and open commands are not supported.

document.queryCommandEnabled

Behavior change. The createLink and insertImage commands don't create a UI. The saveAs and open commands are not supported.

document.queryCommandIndeterm

Behavior change. The createLink and insertImage commands don't create a UI. The saveAs and open commands are not supported.

document.queryCommandState

Behavior change. The createLink and insertImage commands don't create a UI. The saveAs and open commands are not supported.

document.queryCommandSupported

Behavior change. The createLink and insertImage commands don't create a UI. The saveAs and open commands are not supported.

document.queryCommandValue

Behavior change. The createLink and insertImage commands don't create a UI. The saveAs and open commands are not supported.

document.write

Behavior change. Content is filtered as through it was processed by the toStaticHTML method. Trying to inject HTML that contains an unknown element, event handlers, script or references to script, or unknown CSS pseudo-elements and pseudo-classes causes an exception when you add the HTML to the page's DOM. For more info, see Making HTML safer: details for toStaticHTML.

document.writeln

Behavior change. Content is filtered as through it was processed by the toStaticHTML method. Trying to inject HTML that contains an unknown element, event handlers, script or references to script, or unknown CSS pseudo-elements and pseudo-classes causes an exception when you add the HTML to the page's DOM. For more info, see Making HTML safer: details for toStaticHTML.

DOMParser.parseFromString

Behavior change. Content is filtered as through it was processed by the toStaticHTML method. Trying to inject HTML that contains an unknown element, event handlers, script or references to script, or unknown CSS pseudo-elements and pseudo-classes causes an exception when you add the HTML to the page's DOM. For more info, see Making HTML safer: details for toStaticHTML.

innerHTML

Behavior change. Content is filtered as through it was processed by the toStaticHTML method. Trying to inject HTML that contains an unknown element, event handlers, script or references to script, or unknown CSS pseudo-elements and pseudo-classes causes an exception when you add the HTML to the page's DOM. For more info, see Making HTML safer: details for toStaticHTML.

insertAdjacentHTML

Behavior change. Content is filtered as through it was processed by the toStaticHTML method. Trying to inject HTML that contains an unknown element, event handlers, script or references to script, or unknown CSS pseudo-elements and pseudo-classes causes an exception when you add the HTML to the page's DOM. For more info, see Making HTML safer: details for toStaticHTML.

navigator.appCodeName

Not supported.

navigator.mimeTypes

Not supported.

navigator.plugins

Not supported.

onbeforeunload

Behavior change.

  • If your onbeforeunload event handler returns false, null, undefined, or nothing, the app calls the onunload event handler.
  • If the onbeforeunload event handler returns a string from and the app is running, the app displays a Flyout containing the string returned as a prompt with Continue and Cancel buttons. Continue proceeds with the navigation, Cancel terminates the navigation.
  • If the onbeforeunload event handler returns true and the app is running, the app doesn't display any prompt to the user at all and cancels the navigation. onunload is not called.
  • If the onbeforeunload event handler returns anything and the app is not running, the app ignores the return value and proceeds to call the onunload event handler.

outerHTML

Behavior change. Content is filtered as through it was processed by the toStaticHTML method. Trying to inject HTML that contains an unknown element, event handlers, script or references to script, or unknown CSS pseudo-elements and pseudo-classes causes an exception when you add the HTML to the page's DOM. For more info, see Making HTML safer: details for toStaticHTML.

pasteHTML

Behavior change. Content is filtered as through it was processed by the toStaticHTML method. Trying to inject HTML that contains an unknown element, event handlers, script or references to script, or unknown CSS pseudo-elements and pseudo-classes causes an exception when you add the HTML to the page's DOM. For more info, see Making HTML safer: details for toStaticHTML.

removeBehavior

Not supported.

responseXML

Behavior change. For Windows Runtime apps using JavaScript, this property returns the web-standards based DOMParser object instead of the ActiveX-based object.

title

Behavior change. The title element doesn't render.

window.alert

Not supported. (This method works when your app is in development mode, though, so that you can use it to debug.)

window.close

Terminates the app. You can call it only from local context pages.

window.confirm

Not supported.

window.dialogArguments

Not supported.

window.dialogHeight

Not supported.

window.dialogLeft

Not supported.

window.dialogTop

Not supported.

window.dialogWidth

Not supported.

window.execScript

Behavior change. This method can be used to execute only JavaScript. It can't be used to execute VBScript.

window.external

Not supported.

window.menuArguments

Not supported.

window.moveBy

Not supported.

window.moveTo

Not supported.

window.onhelp

Not supported.

window.open

Not supported.

window.prompt

Not supported.

window.resizeBy

Not supported.

window.resizeTo

Not supported.

window.returnValue

Not supported.

window.sessionStorage

This property appears to work, but data is lost when the app is terminated. Do not use this property to store app state.

window.showHelp

Not supported.

window.showModalDialog

Not supported.

window.showModelessDialog

Not supported.

xhr.responseBody

Not supported.