473,490 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Self-modifying HTML code?

AES
Can an HTML web page dynamically modify its own code?

(without resort to Java or any other non-HTML complexities)

That is, is there any provision in HTML such that a single
"Next" button on a main or index.html page will:

a) Change an image displayed on that page (say Picture_1.jpg)
to the next image in a sequence (say Picture_2.jpg), AND

b) "Reprogram" the Next button so that when its clicked again
it will replace Picture_2.jpg with Picture_3.jpg, and so on
thru a sequence of images.

Result could be a "one page slide show" with

* index.html and Picture_1, Picture_2, etc, being the ONLY files on
the web site; no other intermediate "linking" HTML pages.

* Picture_1, Picture_2, etc, being pure JPEG files -- no hidden HTML.

* Any individual picture immediately replaceable with newer version,
with no recoding

* Identical index pages will work with different picture sequences
provided each index page and sequence are in different folders

* No "gallery" with thumbnails of individual slides needed

This is not possible in pure HTML . . right?
Aug 17 '06 #1
12 4793
AES wrote:
Can an HTML web page dynamically modify its own code?

(without resort to Java or any other non-HTML complexities)
No.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Aug 17 '06 #2
AES wrote:
Can an HTML web page dynamically modify its own code?

(without resort to Java or any other non-HTML complexities)
HTML doesn't do anything dynamically. HTML only describes content. It
contains no instructions.
Aug 17 '06 #3
AES <si*****@stanford.eduwrites:
Can an HTML web page dynamically modify its own code?
No.
This is not possible in pure HTML . . right?
No, but add a bit of CSS and it more-or-less works. Sort of. On a good
day.
http://www.dur.ac.uk/c.i.morris/htmlslides.html

Works in Gecko-based browsers, doesn't work in IE or Opera. I haven't
tested anything else. Since it requires styling of form controls and
uses the <buttonelement, it's perhaps not surprising it's incredibly
unreliable (and with serious accessibility problems even when it does
work).

You'd be better off with a server-side image gallery, optionally (and
it probably isn't worth it) with support for Javascript to let you
avoid full-page reloads.

--
Chris
Aug 17 '06 #4

AES wrote:
Can an HTML web page dynamically modify its own code?
No, you'll need JavaScript and a DOM.

Also don't think about "modifying its own code". The HTML code is
supplied from the server to the client by HTTP, then parsed into the
DOM and rendered onto the display. After this the code should be
thought of as not being of further interest. Instead you should modify
the DOM, using a different set of JavaScript methods.

You _can_ "modify the HTML code" using document.write() and similar
JavaScript functions. This is an obsolete technique though and causes
all sorts of problems, particularly if you want to work with XMl in the
future. So don't learn to do it this way, learn to do it through the
DOM.

Aug 17 '06 #5
Andy Dingley wrote:
AES wrote:
>Can an HTML web page dynamically modify its own code?

No, you'll need JavaScript and a DOM.

Also don't think about "modifying its own code". The HTML code is
supplied from the server to the client by HTTP, then parsed into the
DOM and rendered onto the display. After this the code should be
thought of as not being of further interest. Instead you should modify
the DOM, using a different set of JavaScript methods.
You don't modify the DOM. The Document Object Model is the model used
for representing the document, and any modifications to it are by
committee vote. What Javascript modifies is the document, via changes to
its DOM-based representation.

Aug 17 '06 #6
In our last episode,
<si***************************@news.stanford.edu >,
the lovely and talented AES
broadcast on comp.infosystems.www.authoring.html:
Can an HTML web page dynamically modify its own code?
No. HTML is not a programming language. It is markup.

--
Lars Eighner <http://larseighner.com/ <http://myspace.com/larseighner>
Consider what might be fertilizing the greener grass across the fence.
Aug 17 '06 #7
On 17 Aug 2006 10:07:29 -0700, "Andy Dingley" <di*****@codesmiths.com>
wrote:
>You _can_ "modify the HTML code" using document.write() and similar
JavaScript functions. This is an obsolete technique though and causes
all sorts of problems, particularly if you want to work with XMl in the
future. So don't learn to do it this way, learn to do it through the
DOM.
We're getting a little off-topic here, but I've not so far had any
problems using document.write(). I've mainly used it to write buttons
which won't do anything if Javascript is disabled, and which are thus
best not shown in that case. I can easily imagine it could give problems
if used to extrude ill-formed markup, but does it give problems
otherwise?
--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Aug 17 '06 #8
Lars Eighner wrote:
In our last episode,
<si***************************@news.stanford.edu >, the lovely and
talented AES broadcast on comp.infosystems.www.authoring.html:
>Can an HTML web page dynamically modify its own code?

No. HTML is not a programming language. It is markup.
What's the difference? XSLT is also "markup" - but XSLT contains
constructs such as for-loops and switch/case constructs.

So this is an artificial distinction.
--
Jack.
http://www.jackpot.uk.net/
Aug 17 '06 #9
On 2006-08-17, Jack wrote:
Lars Eighner wrote:
>In our last episode,
<si***************************@news.stanford.edu> , the lovely and
talented AES broadcast on comp.infosystems.www.authoring.html:
>>Can an HTML web page dynamically modify its own code?

No. HTML is not a programming language. It is markup.

What's the difference? XSLT is also "markup" - but XSLT contains
constructs such as for-loops and switch/case constructs.
Then XSLT is a mark-up and programming language. HTML is only a
mark-up language.
So this is an artificial distinction.
--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Aug 17 '06 #10
AES
In article <ec*******************@news.demon.co.uk>,
Jack <mr*********@nospam.jackpot.uk.netwrote:
No. HTML is not a programming language. It is markup.

What's the difference? XSLT is also "markup" - but XSLT contains
constructs such as for-loops and switch/case constructs.
Similarly with TeX.
Aug 17 '06 #11

Harlan Messinger wrote:
Instead you should modify
the DOM, using a different set of JavaScript methods.
You don't modify the DOM. The Document Object Model is the model used
for representing the document, and any modifications to it are by
committee vote. What Javascript modifies is the document, via changes to
its DOM-based representation.
Yukka ? Is that you ?
Anyway, it's JavaScript and classes are first-class objects (this is
what passes for OOP in JavaScript). You _can_ modify the DOM 8-)

Might I also suggest that it's Summer and you clearly need a holiday.

Aug 18 '06 #12
Andy Dingley wrote:
Harlan Messinger wrote:
>>Instead you should modify
the DOM, using a different set of JavaScript methods.
>You don't modify the DOM. The Document Object Model is the model used
for representing the document, and any modifications to it are by
committee vote. What Javascript modifies is the document, via changes to
its DOM-based representation.

Yukka ? Is that you ?
Because I think randomly substituting terms for each other makes
discussions more difficult to follow, and technical concepts harder to
grasp, particularly for the less experienced?

Perhaps you'd feel at home on the Marklar world:

http://en.wikipedia.org/wiki/Fiction...h_Park#Marklar
:-P
>
Anyway, it's JavaScript and classes are first-class objects (this is
what passes for OOP in JavaScript). You _can_ modify the DOM 8-)
Well, OK, but then you're making it a *different* DOM, not the W3C DOM.
Might I also suggest that it's Summer and you clearly need a holiday.
Well, again, why? Do people who are rested not benefit from clarity?
Aug 18 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9619
by: Jim Jewett | last post by:
Normally, I expect a subclass to act in a manner consistent with its Base classes. In particular, I don't expect to *lose* any functionality, unless that was the whole point of the subclass. ...
3
1877
by: Max M | last post by:
# -*- coding: latin-1 -*- """ I subclass datetime and timedelta >>> dt = myDatetime(1970,1,1) >>> type(dt) <class 'dtime.myDatetime'>
4
2747
by: David Coffin | last post by:
I'd like to subclass int to support list access, treating the integer as if it were a list of bits. Assigning bits to particular indices involves changing the value of the integer itself, but...
5
1384
by: Mark Harrison | last post by:
Is there a way to do something equivalent to "import * from self"? Perhaps I'm doing something wrong, but I'm having a headache when dealing with class instance data, forgetting to always put the...
7
1890
by: Andrew Robert | last post by:
Hi Everyone, I am having a problem with a class and hope you can help. When I try to use the class listed below, I get the statement that self is not defined. test=TriggerMessage(data) var...
24
2263
by: Peter Maas | last post by:
The Python FAQ 1.4.5 gives 3 reasons for explicit self (condensed version): 1. Instance variables can be easily distinguished from local variables. 2. A method from a particular class can be...
84
7121
by: braver | last post by:
Is there any trick to get rid of having to type the annoying, character-eating "self." prefix everywhere in a class? Sometimes I avoid OO just not to deal with its verbosity. In fact, I try to...
6
1788
by: Bart Kastermans | last post by:
I am playing with some trees. In one of the procedures I wrote for this I am trying to change self to a different tree. A tree here has four members (val/type/left/right). I found that self = SS...
1
2083
by: lpyth | last post by:
class abc: def __init__(self,x,y,z): self.x = x self.y = y self.z = z def add(self): c = self.x + self.y + self.z
3
1334
by: Aaron Gray | last post by:
Regarding 'self' :- if (self) document.write( "self<br>"); if (self === window) document.write( "self === window<br>"); else if (self == window) document.write( "self == window<br>");
0
7108
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7142
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7352
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4875
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.