views:

130

answers:

10

I keep hearing, especially here on StackOverflow, about people generating webpage content "dynamically." Does this mean generating content anytime after design time, or only on the client side, or some other definition?

In other words, as it relates to web development, what is the definition of "dynamic"?

+1  A: 

It refers to the possibility of generation of complete web pages based on content that was not known or available at the time that the "scaffolding" for the web pages was created.

Ignacio Vazquez-Abrams
+2  A: 

This means that you are generating HTML through code, i.e., PHP, python, etc. Instead of hosting static HTML pages, you can generate HTML which is representative of the current state of your site/DB.

Ed Swangren
It seems to me that `<?php echo '<html><title>Hello</title><body>World</body></html>'; ?>` isn't all that dynamic no matter *how* many times I execute it.
Ignacio Vazquez-Abrams
@Ignacio Vazquez-Abrams: that is completely irrelevant. You said it yourself : you have to execute it.
houbysoft
@houbysoft: It's only irrelevant based on a certain definition of dynamic, definitions of which, by the way, this *community wiki* question is trying to explore! If one's definition of dynamic is "changes in value given different inputs" then this is a valid point.
Mark Peters
But the OP is not interested in the definition of the word 'dynamic', he is interested in the definition as it is typically thought of when creating a website. Sure, you can generate static HTML that way, but I think you are splitting hairs here
Ed Swangren
@Mark Peters: Well, the question states "people generating webpage content dynamically." For this type of usage of the word "dynamic", the code is definitively dynamic no matter if its output stays the same.
houbysoft
@houbysoft and @Ed: If the OP knew a definitive definition of "dynamic" in this scenario, then obviously this question wouldn't have been asked. But using a particular definition of "dynamic" to strike down a comment, where that comment is *discussing* which definition of "dynamic" is valid in this scenario, is just **begging the question.** I'm not disagreeing with your definitions of dynamic; I'm just saying calling it "completely irrelevant" is wrong. It's exactly relevant.
Mark Peters
OK, but I still think you are nitpicking. I think we can all agree on general definition of dynamically generated HTML.
Ed Swangren
+1  A: 

A dynamic web page give you new information for each view (maybe). For example, a static webpage has always the same information on it, a dynamic web page contents can change, depending on specific variables, like which user is logged in etc.

Fredrik_jakob
+1  A: 

Values that are not hard coded into the code that forms the website. The values can come from a number of sources including databases which have their content created by users, or scraped from other websites or any other number of places.

belvedere
+1  A: 

Static content is not changed between requests, dynamic content may be changed depends of time, request parameters etc. Static content usually is stored in files (like html, css, images, scripts etc.). Dynamic content is generated. Generation process usually uses two parts: page template that contains page markup in special format with placeholders for dynamic parts, and other data that are obtained from external sources like database, web service etc. Special application combines template with data to get final html (or other content) is responded to request.

STO
+1  A: 

Dynamic content is by definition changes with time and person.Your gmail data is different from mine(person).Both of us receive emails regularly(time),atleast.

Srinivas Reddy Thatiparthy
+2  A: 

Everything that involves more on the part of the server than to just transmit a file on its harddisk.

houbysoft
+1  A: 

As with any popular word, people use it to mean many different things.

  • Original definition: static web pages were just a file that the server read off the disk and served verbatim. dynamic pages included code, such as PHP, that was interpreted by the server and replaced with specially-tailored information before it was sent to the user.

Static pages don't really exist anymore. Any site you care about will be "dynamic" in some form. As a result, the term got recycled to mean any number of things:

  1. A page that rearranges its DOM and/or CSS after it has been received from the server. This is usually accomplished with Javascript, and may involve hiding/showing different parts of the page or displaying them in different ways. For example, a tabbed interface that displays different pieces of the page depending on which tab the user clicks on.
  2. A page that requests new information from the server with AJAX requests and displays it using a method similar to #1. For example, user clicks on "More..." next to an article stub and the entire article is loaded and displayed without the need for a full page refresh.
Ender
A: 

A dynamic web page is a kind of web page that has been prepared with fresh information (content and/or layout), for each individual viewing. It is not static because it changes with: the time (ex. a news content), the user (ex. preferences in a login session), the user interaction (ex. web page game), the context (parametric customization), or all of them.

Ajax combines client and server side dynamic data.

Tommy
A: 

Dynamically has been used to mean: 1. content or result generated on the fly. not ahead of time. generation follows some kind of process where a script or function is invoked. 2. re-calculated, not cached. 3. using some kind of lookup (as in the case of dynamic methods in an object). 4. not statically.

Warren P