Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [dom]

The tag has no usage guidance.

1
vote
2answers
153 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
1answer
41 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
1answer
134 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. ...
2
votes
0answers
291 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
1answer
460 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 ...
5
votes
3answers
4k 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
1answer
43 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
1answer
84 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
1answer
413 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
0answers
172 views

Javascript: How to get the Object an 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 ...
2
votes
1answer
491 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
1answer
606 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 ...
10
votes
1answer
4k 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
2answers
833 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
2answers
1k 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
4answers
2k 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?
25
votes
1answer
14k 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 ...
2
votes
3answers
792 views

Reasons for moving from pure 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
3answers
998 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
0answers
47 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
5answers
443 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
3answers
208 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
1answer
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
1answer
884 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
1answer
723 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
1answer
987 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 ...
41
votes
3answers
10k 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
1answer
202 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 ...
2
votes
2answers
104 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: ...
3
votes
1answer
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
3answers
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 ...