473,774 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
+ 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 4823
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*****@stanfo rd.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 <buttonelemen t, 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.infosystem s.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*****@codesm iths.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.infosystem s.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.infosystem s.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

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

Similar topics

2
9644
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. (e.g., a security-restricted version, or an interface implementation that doesn't require a filesystem.) One (common?) exception seems to occur in initialization. I understand stripping out arguments that your subclass explicitly handles or...
3
1897
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
2787
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 changing 'self' obviously just alters the value of that local variable. Is there some way for me to change the value of the BitSequence object itself? I've also tried wrapping and delegating using __getattr__, but I couldn't figure out how to handle...
5
1395
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 "self." prefix For example, in my brain I'm thinking: optc,args=getopt.getopt(args,cmdopts, cmdopts) but I'm having to type:
7
1910
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 = test.decode(self.qname)
24
2300
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 called as baseclass.methodname(self, <argument list>). 3. No need for declarations to disambiguate assignments to local/instance variables.
84
7223
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 use Ruby anywhere speed is not crucial especially for @ prefix is better- looking than self. But things grow -- is there any metaprogramming tricks or whatnot we can throw on the self? Cheers,
6
1814
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 does not work; I have to write self.val = SS.val and the same for the other members (as shown below). Is there a better way to do this? In the below self is part of a parse tree, F is the parse tree of a function f with argument x. If a node...
1
2105
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
1363
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
9621
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7463
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.