documentfragment Questions
6
Solved
No libraries please. Beyond my control.
I'm appending a document fragment to the dom. THIS ALL WORKS. No problemo.
How do I retain/retrieve the node list after the fragment is appended? Relevant...
Dyslogia asked 9/11, 2012 at 20:25
4
Let's say I have an array like this:
var content = [ $('<p>...</p>'), $('<p>...</p>') ];
I need to get the markup of the concatenated elements. So I need to convert conte...
Sentry asked 22/7, 2010 at 17:44
3
Solved
Sometimes you might need to render web-components from your react app.
Web-components often use a special <template> ... </template> tag.
But if I try to render such markup with react ...
Marlow asked 16/3, 2017 at 21:35
2
Solved
Can anyone please explain briefly what documentFragment actually does? I have been searching for a clear explanation but I don't get any until now.
what I read is, documentFragment is something lik...
Andreasandree asked 7/8, 2017 at 6:29
3
Solved
Consider this HTML template with two flat x-elements and one nested.
<template id="fooTemplate">
<x-element>Enter your text node here.</x-element>
<x-element>
<x-elem...
Flanker asked 22/4, 2019 at 8:7
11
Solved
I know that adding innerHTML to document fragments has been recently discussed, and will hopefully see inclusion in the DOM Standard. But, what is the workaround you're supposed to use in the meant...
Bellyache asked 14/2, 2012 at 21:0
3
Is it possible to have DocumentFragments contain tr, th or td tags?
If I do this:
var template = document.createRange().createContextualFragment(
'<table></table>'
);
console.log(...
Ginnie asked 29/3, 2017 at 19:54
2
Solved
I am following the instructions given on MDN to use <template>. Slightly different those give in example, my code is:
<template id="template">
<tr>
<td name="id"></td&...
Toothwort asked 21/9, 2019 at 6:48
6
Solved
Is there a way to get the html string of a JavaScript Range Object in W3C compliant browsers?
For example, let us say the user selects the following: Hello <b>World</b>
It is possible ...
Tapes asked 4/2, 2011 at 10:28
7
I've got a doubt regarding performance in JS.
Say, I've got the next code:
var divContainer = document.createElement("div"); divContainer.id="container";
var divHeader = document.createElement("d...
Lymphangitis asked 7/1, 2013 at 20:4
2
Solved
I am creating a lot of DOM elements (each has the same HTML structure) with the <template> tag:
<template id="weapon-template">
<div class="button">
<div class="button-price...
Tseng asked 21/6, 2015 at 19:13
8
Solved
var oFra = document.createDocumentFragment();
// oFra.[add elements];
document.createElement("div").id="myId";
oFra.getElementById("myId"); //not in FF
How can I get "myId" before attaching fragm...
Planetoid asked 29/10, 2009 at 12:24
3
Solved
I'm trying to replace all contents of an element with a document fragment:
var frag = document.createDocumentFragment()
The document fragment is being created just fine. No problems there. I add ...
Coprolalia asked 9/11, 2012 at 15:19
2
Depending on the content of a <template>, I want to wrap its contents in a container for easier/consistent traversal. If the contents are <style> and <one-other-element> at the to...
Martellato asked 19/8, 2015 at 9:40
1
The first log returns a full li element while the second one returns an empty DocumentFragment. Why? I couldn't find any information about that behavior in any documentation.
var main = documen...
Development asked 30/3, 2015 at 17:57
1
Solved
Looking into articles on ShadowDOM it seems like it's an enhancement to DocumentFragments. What is the real benefit of ShadowDOM? CSS specificity? Can't I do roughly the same things with Frag...
Solis asked 16/12, 2014 at 19:35
3
Solved
This is how I can parse a well-formed XML document in Java:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
// text ...
Betz asked 11/8, 2011 at 13:2
1
Solved
Since some time, when I inspect an input in Chrome, I see those strange #document-fragment greyed-out elements. I also notice that sometimes there are more, and sometimes there are less of them.
W...
Aggappera asked 6/2, 2014 at 11:16
2
Solved
I want to display an SVG image stored in a file and bind an angularJs ng-click function to the image.
I've tried putting the ng-click binding in the object/embed element tag as well as a wrapper ...
Vip asked 16/11, 2013 at 13:43
1
I need to do some DOM surgery on a DocumentFragment, and I'm trying to use XPath to find the nodes that need to be modified. However, I can't figure out how to get document.evaluate to work on a fr...
Primordial asked 9/8, 2013 at 20:46
4
Solved
I've been looking at using documentFragments in a Backbone.js app and was wondering why I see examples where "cloneNode" is used when appending the documentFragment to the parent DOM element.
An e...
Sector asked 13/12, 2012 at 10:44
1
Solved
Using DocumentFramgment allows us to attach DOM elements to each other without causing a browser reflow (i.e. work with offline DOM trees). A lot of libraries like jQuery use document fragments to ...
Consolata asked 31/3, 2013 at 18:27
3
Solved
So I've read that jQuery uses document fragments internally to make rendering faster. But I am wondering if anyone knows if jQuery would use createDocumentFragment in this situation where I'm appen...
Taste asked 30/1, 2013 at 22:58
2
Solved
When creating new html node in jQuery using
$('<some-node>some html code</some-node>');
it won't become part of DOM, until you attach it. However, it does not mean, the node has no p...
Gorga asked 29/4, 2012 at 12:52
1
© 2022 - 2024 — McMap. All rights reserved.