Questions tagged [dhtml]

Dynamic HTML, or DHTML, is an umbrella term for a collection of technologies used together to create interactive and animated web sites by using a combination of a static markup language (such as HTML), a client-side scripting language (such as JavaScript), a presentation definition language (such as CSS), and the Document Object Model.

Dynamic HTML, or DHTML, is an umbrella term for a collection of technologies used together to create interactive and animated web sites by using a combination of a static markup language (such as ), a client-side scripting language (such as ), a presentation definition language (such as ), and the .

DHTML allows scripting languages to change variables in a web page's definition language, which in turn affects the look and function of otherwise "static" HTML page content, after the page has been fully loaded and during the viewing process. Thus the dynamic characteristic of DHTML is the way it functions while a page is viewed, not in its ability to generate a unique page with each page load.

By contrast, a dynamic web page is a broader concept — any web page generated differently for each user, load occurrence, or specific variable values. This includes pages created by client-side scripting, and ones created by server-side scripting (such as , , or ) where the web server generates content before sending it to the client.


Resources :

747 questions
1353
votes
15 answers

jQuery document.createElement equivalent?

I'm refactoring some old JavaScript code and there's a lot of DOM manipulation going on. var d = document; var odv = d.createElement("div"); odv.style.display = "none"; this.OuterDiv = odv; var t = d.createElement("table"); t.cellSpacing =…
Rob Stevenson-Leggett
  • 35,279
  • 21
  • 87
  • 141
1164
votes
17 answers

How do I retrieve an HTML element's actual width and height?

Suppose that I have a
that I wish to center in the browser's display (viewport). To do so, I need to calculate the width and height of the
element. What should I use? Please include information on browser compatibility.
snortasprocket
  • 11,801
  • 3
  • 19
  • 8
626
votes
8 answers

How do I attach events to dynamic HTML elements with jQuery?

Suppose I have some jQuery code that attaches an event handler to all elements with class .myclass. For example: $(function(){ $(".myclass").click( function() { // do something }); }); And my HTML might be as follows:
frankadelic
  • 20,543
  • 37
  • 111
  • 164
541
votes
33 answers

Print
only?

How do I print the indicated div (without manually disabling all other content on the page)? I want to avoid a new preview dialog, so creating a new window with this content is not useful. The page contains a couple of tables, one of them contains…
noesgard
  • 5,917
  • 3
  • 20
  • 27
393
votes
19 answers

How to load up CSS files using Javascript?

Is it possible to import css stylesheets into a html page using Javascript? If so, how can it be done? P.S the javascript will be hosted on my site, but I want users to be able to put in the tag of their website, and it should be able to…
Ali
  • 261,656
  • 265
  • 575
  • 769
383
votes
14 answers

Redirect parent window from an iframe action

What JavaScript do I need to use to redirect a parent window from an iframe? I want them to click a hyperlink which, using JavaScript or any other method, would redirect the parent window to a new URL.
Ali
  • 261,656
  • 265
  • 575
  • 769
224
votes
30 answers

Getting all selected checkboxes in an array

So I have these checkboxes: And so on. There are about 6…
Ali
  • 261,656
  • 265
  • 575
  • 769
204
votes
9 answers

Modifying a query string without reloading the page

I am creating a photo gallery, and would like to be able to change the query string and title when the photos are browsed. The behavior I am looking for is often seen with some implementations of continuous/infinite page, where while you scroll down…
Sonic Soul
  • 23,855
  • 37
  • 130
  • 196
202
votes
6 answers

Capture iframe load complete event

Is there a way to capture when the contents of an iframe have fully loaded from the parent page?
Jaime Garcia
  • 6,744
  • 7
  • 49
  • 61
157
votes
18 answers

Change :hover CSS properties with JavaScript

How can JavaScript change CSS :hover properties? For example: HTML
Hover 1 Hover 2
CSS table td:hover { background:#ff0000; } How can the td :hover properties be modified to, say,…
zdebruine
  • 3,687
  • 6
  • 31
  • 50
132
votes
7 answers

Adding and removing style attribute from div with jquery

I've inherited a project I'm working on and I'm updating some jquery animations (very little practice with jquery). I have a div I need to add and remove the style attribute from. Here is the div:
At one point in the…
ItsPronounced
  • 5,475
  • 13
  • 47
  • 86
129
votes
11 answers

What is the best JavaScript code to create an img element

I want to create a simple bit of JS code that creates an image element in the background and doesn't display anything. The image element will call a tracking URL (such as Omniture) and needs to be simple and robust and work in IE 6 =< only. Here…
Pete
  • 1,455
  • 2
  • 12
  • 9
116
votes
8 answers

Is there a best practice for generating html with javascript

I'm calling a web service that returns an array of objects in JSON. I want to take those objects and populate a div with HTML. Let's say each object contains a url and a name. If I wanted to generate the following HTML for each object:
ckarbass
  • 3,651
  • 7
  • 34
  • 43
112
votes
2 answers

Change textNode value

Is there any way to change the value of a DOM textNode in web browser? I specifically want to see if I can change the existing node, rather than creating a new one. To clarify, I need to do this with Javascript. All text in the browser is stored in…
levik
  • 114,835
  • 27
  • 73
  • 90
92
votes
7 answers

getElementsByTagName() equivalent for textNodes

Is there any way to get the collection of all textNode objects within a document? getElementsByTagName() works great for Elements, but textNodes are not Elements. Update: I realize this can be accomplished by walking the DOM - as many below…
levik
  • 114,835
  • 27
  • 73
  • 90
1
2 3
49 50