摘要:代碼資料文件文件文件關(guān)于系列的的網(wǎng)頁的操作需要權(quán)限的相關(guān)文檔關(guān)于瀏覽器無法一些元素?zé)o法設(shè)置屬性的解決方案和原因
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, };關(guān)于Windows8系列的APP的網(wǎng)頁的innerHTML操作需要權(quán)限的相關(guān)文檔:
execUnsafeLocalFunction method : https://msdn.microsoft.com/zh...
The new Windows 10 security model for HTML/Javascript apps. : https://github.com/MicrosoftE...
關(guān)于IE瀏覽器無法一些元素?zé)o法設(shè)置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 = "
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/99391.html
摘要:對的兩個主要拓展是選擇和。以下插入標(biāo)記的拓展已經(jīng)納入了規(guī)范。在寫模式下,會根據(jù)指定的字符串創(chuàng)建新的子樹,然后用這個子樹完全替換調(diào)用元素。在刪除帶有時間處理程序或引用了其他對象子樹時,就有可能導(dǎo)致內(nèi)存占用問題。 盡管DOM作為API已經(jīng)非常完善了,但為了實現(xiàn)更多功能,仍然會有一些標(biāo)準(zhǔn)或?qū)S械耐卣埂?008年之前,瀏覽器中幾乎所有的拓展都是專有的,此后W3C著手將一些已經(jīng)成為事實標(biāo)準(zhǔn)的專...
摘要:相關(guān)最大的特性就在于直接操縱網(wǎng)頁上的節(jié)點(diǎn),從而實現(xiàn)網(wǎng)頁的局部刷新而非全局刷新。該回調(diào)函數(shù)會在送回響應(yīng)的時候被調(diào)用。當(dāng)然了,如果瀏覽器不支持對象,會返回,在這時需要進(jìn)行額外的處理。 前言 馬上就要參加一個團(tuán)隊項目進(jìn)行React的前端開發(fā)了。最近正在著手熟練React語法,然后發(fā)現(xiàn)本質(zhì)上還是建立在對javascript的深刻理解上。市面上在js基礎(chǔ)上封裝出了非常多優(yōu)秀的車輪,其中最被新手廣...
摘要:常見內(nèi)存泄漏情形全局變量被忘記的或者閉包引用閉包概念有權(quán)訪問另一個函數(shù)作用域的變量的函數(shù)。會話存儲刷新頁面依舊存在,與在持久上不同外,其余一致。請求向指定的資源提交被處理的數(shù)據(jù),數(shù)據(jù)量和類型沒限制,不主動緩存,頁面刷新數(shù)據(jù)會被重新提交。 defer 腳本延遲執(zhí)行,適用于外部腳本文件async 立即下載,不保證順序(建議不修改DOM,避免重繪) CDN加速 (Content De...
閱讀 2485·2023-04-26 02:18
閱讀 1271·2021-10-14 09:43
閱讀 3841·2021-09-26 10:00
閱讀 6986·2021-09-22 15:28
閱讀 2550·2019-08-30 15:54
閱讀 2612·2019-08-30 15:52
閱讀 486·2019-08-29 11:30
閱讀 3475·2019-08-29 11:05