摘要:代碼資料文件文件文件關于系列的的網頁的操作需要權限的相關文檔關于瀏覽器無法一些元素無法設置屬性的解決方案和原因
react代碼資料:
文件:packages/react-dom/src/client/setInnerHTML.js
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ import {Namespaces} from "../shared/DOMNamespaces"; import createMicrosoftUnsafeLocalFunction from "../shared/createMicrosoftUnsafeLocalFunction"; // SVG temp container for IE lacking innerHTML let reusableSVGContainer; /** * Set the innerHTML property of a node * * @param {DOMElement} node * @param {string} html * @internal */ const setInnerHTML = createMicrosoftUnsafeLocalFunction(function( node: Element, html: string, ): void { // IE does not have innerHTML for SVG nodes, so instead we inject the // new markup in a temp node and then move the child nodes across into // the target node if (node.namespaceURI === Namespaces.svg && !("innerHTML" in node)) { reusableSVGContainer = reusableSVGContainer || document.createElement("div"); reusableSVGContainer.innerHTML = ""; const svgNode = reusableSVGContainer.firstChild; while (node.firstChild) { node.removeChild(node.firstChild); } while (svgNode.firstChild) { node.appendChild(svgNode.firstChild); } } else { node.innerHTML = html; } }); export default setInnerHTML;
文件:packages/react-dom/src/shared/createMicrosoftUnsafeLocalFunction.js
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* globals MSApp */ /** * Create a function which has "unsafe" privileges (required by windows8 apps) */ const createMicrosoftUnsafeLocalFunction = function(func) { if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction) { return function(arg0, arg1, arg2, arg3) { MSApp.execUnsafeLocalFunction(function() { return func(arg0, arg1, arg2, arg3); }); }; } else { return func; } }; export default createMicrosoftUnsafeLocalFunction;
文件:packages/react-dom/src/shared/DOMNamespaces.js
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; const MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML"; const SVG_NAMESPACE = "http://www.w3.org/2000/svg"; export const Namespaces = { html: HTML_NAMESPACE, mathml: MATH_NAMESPACE, svg: SVG_NAMESPACE, };關于Windows8系列的APP的網頁的innerHTML操作需要權限的相關文檔:
execUnsafeLocalFunction method : https://msdn.microsoft.com/zh...
The new Windows 10 security model for HTML/Javascript apps. : https://github.com/MicrosoftE...
關于IE瀏覽器無法一些元素無法設置innerHTML屬性的解決方案和原因:https://stackoverflow.com/que...
The property is read/write for all objects except the following, for which it is read-only: COL, COLGROUP, FRAMESET, HEAD, HTML, STYLE, TABLE, TBODY, TFOOT, THEAD, TITLE, TR.
function setTBodyInnerHTML(tbody, html) { var temp = tbody.ownerDocument.createElement("div"); temp.innerHTML = "
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/99391.html
摘要:對的兩個主要拓展是選擇和。以下插入標記的拓展已經納入了規范。在寫模式下,會根據指定的字符串創建新的子樹,然后用這個子樹完全替換調用元素。在刪除帶有時間處理程序或引用了其他對象子樹時,就有可能導致內存占用問題。 盡管DOM作為API已經非常完善了,但為了實現更多功能,仍然會有一些標準或專有的拓展。2008年之前,瀏覽器中幾乎所有的拓展都是專有的,此后W3C著手將一些已經成為事實標準的專...
摘要:相關最大的特性就在于直接操縱網頁上的節點,從而實現網頁的局部刷新而非全局刷新。該回調函數會在送回響應的時候被調用。當然了,如果瀏覽器不支持對象,會返回,在這時需要進行額外的處理。 前言 馬上就要參加一個團隊項目進行React的前端開發了。最近正在著手熟練React語法,然后發現本質上還是建立在對javascript的深刻理解上。市面上在js基礎上封裝出了非常多優秀的車輪,其中最被新手廣...
閱讀 2461·2023-04-26 02:18
閱讀 1262·2021-10-14 09:43
閱讀 3822·2021-09-26 10:00
閱讀 6945·2021-09-22 15:28
閱讀 2535·2019-08-30 15:54
閱讀 2600·2019-08-30 15:52
閱讀 474·2019-08-29 11:30
閱讀 3465·2019-08-29 11:05