Questions tagged [dom]
The dom tag has no usage guidance.
34 questions
4
votes
1
answer
974
views
Need a deeper understanding of how a Virtual DOM is different from a real DOM
As all articles say the Virtual DOM is lightweight and allows us to update only those nodes that has to be updated, unlike the real DOM that updates the whole nodes structure.
So the first question: ...
2
votes
1
answer
188
views
Would invisible custom elements make sense?
The use case I was thinking about was something like this.
I want to make a calendar for a month as a custom element, and I don't think passing up all the event data as JSON or something is the best ...
8
votes
3
answers
17k
views
How do you 'merge' several JS files into one? [closed]
New Web Dev here.
Recently I got into DOM manipulation with JS, everything was sweet with one-page websites, but then I tried with projects with many html files and that's when I got confused.
It's a ...
2
votes
2
answers
2k
views
Is it bad practice to leave hidden elements in the dom?
I'm looking for perspectives from other web/ui developers.
I'm a UI developer and my company requires that I use components built by another team within the company. That team has developed some ...
-3
votes
1
answer
170
views
How does event.target return the DOM object?
I read through documentation and searched on google, but couldn't find a specific answer. Currently, I have an object that subscribes to a click event. I am trying to understand how a view that ...
-2
votes
1
answer
287
views
Why is there no UML or other model added to the DOM specifications? [closed]
I already went through several versions of the DOM and HTML specifications on the W3C's websites but I have never seen a complete overview model or meta model regarding the DOM or the HTML.
...
3
votes
0
answers
433
views
React DOM manipulation vs CSS for responsive breakpoints?
Specifically for ReactJS and responsive frameworks that show/hide elements based on width like Bootstrap.
Because ReactJS has a virtual DOM I am presuming doing the DOM manipulation is faster and in ...
2
votes
1
answer
743
views
How can i test the performance of DOM manipulation code in JS
I want to test the performance of some code snippets in JS using:
function perf() {
var start = new Date()
// the snippet codes
var end = new Date()
return end - start
}
then i wrote some ...
10
votes
3
answers
11k
views
Should I reduce event listeners by making functions more complex?
An example would be if you had multiple inputs, each of which effect a completely different process, (perhaps one changes a div's width, while another sends ajax request for predictive search), would ...
0
votes
1
answer
71
views
Where is the FormData constructor spec? Am I reading this correctly?
Looking at the w3 spec for FormData there seems to be very very little there. Certainly very little compared with the MDN documentation.
Of most concern, there is nothing here that defines ...
0
votes
1
answer
148
views
Can I call DOM event handling an instance of observable/observer pattern
In the following DOM event handling example (using jQuery):
$('#shopping-cart').on('click', function(event){...});
could I not call the shopping-cart DOM element the observable, and the function the ...
5
votes
1
answer
917
views
Best way to verify that a user has completed a task on another website.
We are developing a website for students on which they first have to fulfill specific tasks in order to use our service. The problem is, that those tasks are on another website, which has nothing to ...
2
votes
2
answers
646
views
How to get an object that another object is prototype of?
Javascript in the DOM has a peculiar characteristic. There's a different Object object that an object (by default) inherits per window.
In order to find what kind of object is being sent to a function ...
2
votes
1
answer
640
views
why are iframe-s so useful in HTML5 WYSIWIG applications?
<iframe> elements are documented as
The HTML Inline Frame Element (<iframe>) represents a nested browsing context, effectively embedding another HTML page into the current page.
...
1
vote
1
answer
836
views
How to filter RSS feed results, according to a DOM element in its page content?
I've a "RSS feed", want to filter its results according to a DOM element in its content!
So, this is the mission I'm looking forward to do:
Monitor a "RSS feed" continuously.
If new RSS elements ...
32
votes
1
answer
13k
views
What is the difference between web components and custom elements?
"Web Components" and "Custom elements" are often mixed up, and web searches for the title of this question don't yet produce much clarity. Let's fix that.
4
votes
2
answers
1k
views
Why is the Document Object Model the view?
I was told by a Javascript programmer not to do DOM manipulation in model code.
I also remember hearing a snazzy tune for a JS framework (I forget which one): "Get your models out of the DOM".
This ...
1
vote
2
answers
2k
views
What is the best way to create dynamically a DOM?
I know that there are plenty answers to this question on stackoverflow, but I can´t find one that give me an answer that can help me to solve a question that came out after read a lot of Javascript, ...
-1
votes
4
answers
3k
views
What exactly is the meaning of "node" in Document Object Model (DOM)?
I've searched for the definition of a "node" in a programming language and I am still finding it hard to understand.
Could anyone advice me in simple, layman's terms:
What is a node?
23
votes
1
answer
15k
views
Is vanilla JS still considered a library?
I very recently found out that VanillaJS (document?) is a library that's just bundled with 99% browsers and isn't exactly native JavaScript (shock of my life). While writing a lib of my own I normally ...
1
vote
3
answers
967
views
Reasons for moving from raw JavaScript to a JavaScript library
Being aware of the direct benefits of libraries having things wrapped in a package, making daily work easier, my question is leaning more towards the fact that many features not implemented in HTML/...
4
votes
3
answers
2k
views
Javascript Use of Window Object through alternate means
Disregard your usual paradigms for a mere moment here....
I've seen a few sites who have used the following logic:
a=[];
b=a["sort"];
c=(b)();
c["alert"](1); // intended output: Alert displaying "1"....
0
votes
0
answers
53
views
DOMDocument programming: a lot of little dilemmas, how to solve them?
I need elegance and performance: how to decide by the "best implementation" for each DOM algorithm that I face. This simple "DOMNodeList grouper" illustrate many little dilemmas:
use ...
0
votes
5
answers
447
views
Why do we write the action to be performed by a function in jQuery inside the parentheses?
Generally whenever we're programming in any Programming language, say C, we would pass the parameters we need to pass to a function using the parentheses next to the name of the function. Whereas in ...
7
votes
3
answers
234
views
In DOM, why is childNodes defined in the Node interface if only some node types can have childNodes?
In DOM, why is childNodes defined in the Node interface if only some node types such as Element, Document and DocumentFragement, can have childNodes?
Is this considered a good design? In what cases ...
25
votes
1
answer
4k
views
A few clarifications about the DOM
I have been trying to understand the DOM, and although I have a fair idea of what it is, there are certain ideas I just cannot pin down. I will list down what I think the DOM is and my questions will ...
12
votes
1
answer
983
views
Google Blink (new WebKit fork): Meaning of "Moving DOM into Javascript"?
From the Blink Blog:
Finally we’d like to explore even larger ideas like moving the entire Document Object Model (DOM) into JavaScript.
What does this mean? Does it mean WebKit's DOM is currently ...
0
votes
1
answer
864
views
Why does flask use Jinja2 and not xpath?
I'm just starting out with python and since I'm coming from a PHP background (thus have to adjust my mind to wrap around new concepts) one major question still stands without answer - why does Flask ...
5
votes
1
answer
2k
views
How is the DOM language independent?
Quoting from Wikipedia
The Document Object Model (DOM) is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents.
and ...
49
votes
4
answers
13k
views
What's so bad about the DOM?
I keep hearing people (Crockford in particular) saying the DOM is a terrible API, but not really justifying this statement. Apart from cross-browser inconsistencies, what are some reasons why the DOM ...
2
votes
1
answer
210
views
Can we create a reference to DOM objects like document.location
As we have a wonderful concept called hooking where we can create a reference to a function and connect another function In the same way can we create a reference to DOM objects. For example can we ...
1
vote
2
answers
108
views
How should XML subtree manipulation be handled in a public API?
I'm working on an API whereby a specific call would replace a subtree of an XML document—rooted at some element—with another subtree.
The two options I'm considering for a response to this call are:
...
4
votes
1
answer
1k
views
xpath vs DOM API
I just came up on xpath recently while writing a greasemonkey script and immediately fell in love. I haven't done any benchmarking yet (coming soon), but according to a couple sources that I read, ...
6
votes
3
answers
3k
views
Should jQuery DOM manipulation be avoided in favor of JavaScript template engines?
From what I can tell, most developers will use heavy jQuery DOM manipulation tactics to deliver their updated AJAX views. Once things get out of hand, they may consider refactoring using template ...