By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,848 Members | 3,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,848 IT Pros & Developers. It's quick & easy.

HTML or JavaScript

P: n/a
I can load a dialog by loading an HTML page or by constructing the
dialog with JavaScript.

What should I be thinking about when I look at this choice?
Oct 20 '08 #1
Share this Question
Share on Google+
14 Replies


P: n/a
On Oct 20, 10:45*am, MartinRineh...@gmail.com wrote:
I can load a dialog by loading an HTML page or by constructing the
dialog with JavaScript.

What should I be thinking about when I look at this choice?
It is your choice...
If you load HTML you will have an extra request to your web server to
deal with, if you use JavaScript your client will use some extra CPU
time...
Oct 20 '08 #2

P: n/a
rf

"GArlington" <ga********@tiscali.co.ukwrote in message
news:9f**********************************@m73g2000 hsh.googlegroups.com...
On Oct 20, 10:45 am, MartinRineh...@gmail.com wrote:
I can load a dialog by loading an HTML page or by constructing the
dialog with JavaScript.

What should I be thinking about when I look at this choice?
It is your choice...
If you load HTML you will have an extra request to your web server to
deal with, if you use JavaScript your client will use some extra CPU
time...

And ~10% of the clients will never see it.
Oct 20 '08 #3

P: n/a
rf wrote:
"GArlington" <ga********@tiscali.co.ukwrote in message
news:9f**********************************@m73g2000 hsh.googlegroups.com...
On Oct 20, 10:45 am, MartinRineh...@gmail.com wrote:
>I can load a dialog by loading an HTML page or by constructing the
dialog with JavaScript.

What should I be thinking about when I look at this choice?

It is your choice...
If you load HTML you will have an extra request to your web server to
deal with, if you use JavaScript your client will use some extra CPU
time...
Loading it in HTML does not necessitate an extra http req. Just put it
in the HTML. Requires less javascript to be downloaded.

....
<body>
<h1Heading </h1>
<pyour content here </p>

<div id="panel">
panel content here.
</div>
</body>
....

--
comp.lang.javascript FAQ <URL: http://jibbering.com/faq/ >
Oct 21 '08 #4

P: n/a
dhtml wrote:
rf wrote:
>"GArlington" wrote:
On Oct 20, 10:45 am, MartinRineh...@gmail.com wrote:
>>I can load a dialog by loading an HTML page or by constructing the
dialog with JavaScript.

What should I be thinking about when I look at this choice?
It is your choice...
If you load HTML you will have an extra request to your web server to
deal with, if you use JavaScript your client will use some extra CPU
time...

Loading it in HTML does not necessitate an extra http req. Just put it
in the HTML. Requires less javascript to be downloaded.

...
<body>
<h1Heading </h1>
<pyour content here </p>

<div id="panel">
panel content here.
</div>
</body>
...
You forgot to consider non-graphical user agents, including text browsers
(which usually do not support CSS) and search engines.
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Oct 21 '08 #5

P: n/a
On Oct 21, 1:27*pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
dhtml wrote:
rf wrote:
"GArlington" wrote:
On Oct 20, 10:45 am, MartinRineh...@gmail.com wrote:
I can load a dialog by loading an HTML page or by constructing the
dialog with JavaScript.
>What should I be thinking about when I look at this choice?
It is your choice...
If you load HTML you will have an extra request to your web server to
deal with, if you use JavaScript your client will use some extra CPU
time...
Loading it in HTML does not necessitate an extra http req. Just put it
in the HTML. Requires less javascript to be downloaded.
...
<body>
<h1Heading </h1>
<pyour content here </p>
<div id="panel">
* panel content here.
</div>
</body>
...

You forgot to consider non-graphical user agents, including text browsers
(which usually do not support CSS) and search engines.
True enough, you should always test pages in Lynx (or a simulator) for
just this reason (most pages will read like the gibberish that they
are.)

However, the quoted example would be fine in this regard, so what was
forgotten?
Oct 22 '08 #6

P: n/a
David Mark wrote:
Thomas 'PointedEars' Lahn wrote:
>dhtml wrote:
>>rf wrote:
"GArlington" wrote:
On Oct 20, 10:45 am, MartinRineh...@gmail.com wrote:
I can load a dialog by loading an HTML page or by constructing the
dialog with JavaScript.
What should I be thinking about when I look at this choice?
[...]
Loading it in HTML does not necessitate an extra http req. Just put it
in the HTML. Requires less javascript to be downloaded.
...
<body>
<h1Heading </h1>
<pyour content here </p>
<div id="panel">
panel content here.
</div>
</body>
...
You forgot to consider non-graphical user agents, including text browsers
(which usually do not support CSS) and search engines.

True enough, you should always test pages in Lynx (or a simulator) for
just this reason (most pages will read like the gibberish that they
are.)

However, the quoted example would be fine in this regard, [...]
Isn't it obvious that it would not be fine? The panel is a dialog that
should only be displayed when necessary (requested by a user action).
However, with this markup the "panel" will be displayed always (as a
paragraph) in e.g. Lynx.
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Oct 22 '08 #7

P: n/a
On Oct 22, 5:21*pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
David Mark wrote:
Thomas 'PointedEars' Lahn wrote:
dhtml wrote:
rf wrote:
"GArlington" wrote:
On Oct 20, 10:45 am, MartinRineh...@gmail.com wrote:
I can load a dialog by loading an HTML page or by constructing the
dialog with JavaScript.
What should I be thinking about when I look at this choice?
[...]
Loading it in HTML does not necessitate an extra http req. Just put it
in the HTML. Requires less javascript to be downloaded.
...
<body>
<h1Heading </h1>
<pyour content here </p>
<div id="panel">
* panel content here.
</div>
</body>
...
You forgot to consider non-graphical user agents, including text browsers
(which usually do not support CSS) and search engines.
True enough, you should always test pages in Lynx (or a simulator) for
just this reason (most pages will read like the gibberish that they
are.)
However, the quoted example would be fine in this regard, [...]

Isn't it obvious that it would not be fine? *The panel is a dialog that
No.
should only be displayed when necessary (requested by a user action).
Not necessarily. That may not be possible.
However, with this markup the "panel" will be displayed always (as a
paragraph) in e.g. Lynx.
Yes, Lynx does not support script. That's why the form will always be
there. So what?
Oct 22 '08 #8

P: n/a
David Mark wrote:
Thomas 'PointedEars' Lahn wrote:
>David Mark wrote:
>>Thomas 'PointedEars' Lahn wrote:
dhtml wrote:
rf wrote:
>"GArlington" wrote:
>On Oct 20, 10:45 am, MartinRineh...@gmail.com wrote:
>>I can load a dialog by loading an HTML page or by constructing the
>>dialog with JavaScript.
>>What should I be thinking about when I look at this choice?
[...]
Loading it in HTML does not necessitate an extra http req. Just put it
in the HTML. Requires less javascript to be downloaded.
...
<body>
<h1Heading </h1>
<pyour content here </p>
<div id="panel">
panel content here.
</div>
</body>
...
You forgot to consider non-graphical user agents, including text browsers
(which usually do not support CSS) and search engines.
True enough, you should always test pages in Lynx (or a simulator) for
just this reason (most pages will read like the gibberish that they
are.)
However, the quoted example would be fine in this regard, [...]
Isn't it obvious that it would not be fine? The panel is a dialog that

No.
Apparently not to you (yet).
>should only be displayed when necessary (requested by a user action).

Not necessarily. That may not be possible.
It is entirely possible if the dialog is not in the original HTML document.
Have you even read the thread?
>However, with this markup the "panel" will be displayed always (as a
paragraph) in e.g. Lynx.

Yes, Lynx does not support script. That's why the form will always be
there. So what?
So there would be a dialog (not a form) that does not belong there, which
would be a Bad Thing. Do you need to be guided from A to B to C now?
PointedEars
Oct 22 '08 #9

P: n/a
On Oct 22, 6:20*pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
David Mark wrote:
Thomas 'PointedEars' Lahn wrote:
David Mark wrote:
Thomas 'PointedEars' Lahn wrote:
dhtml wrote:
rf wrote:
"GArlington" wrote:
On Oct 20, 10:45 am, MartinRineh...@gmail.com wrote:
>I can load a dialog by loading an HTML page or by constructing the
>dialog with JavaScript.
>What should I be thinking about when I look at this choice?
[...]
Loading it in HTML does not necessitate an extra http req. Just putit
in the HTML. Requires less javascript to be downloaded.
...
<body>
<h1Heading </h1>
<pyour content here </p>
<div id="panel">
* panel content here.
</div>
</body>
...
You forgot to consider non-graphical user agents, including text browsers
(which usually do not support CSS) and search engines.
True enough, you should always test pages in Lynx (or a simulator) for
just this reason (most pages will read like the gibberish that they
are.)
However, the quoted example would be fine in this regard, [...]
Isn't it obvious that it would not be fine? *The panel is a dialog that
No.

Apparently not to you (yet).
should only be displayed when necessary (requested by a user action).
Not necessarily. *That may not be possible.

It is entirely possible if the dialog is not in the original HTML document.
*Have you even read the thread?
Of course I have. There is exactly one post by the OP and the problem
is outlined in one vague sentence. Perhaps you had a different
interpretation?
>
However, with this markup the "panel" will be displayed always (as a
paragraph) in e.g. Lynx.
Yes, Lynx does not support script. *That's why the form will always be
there. *So what?

So there would be a dialog (not a form) that does not belong there, which
The word "dialog" has no real meaning here. A form in a div?
would be a Bad Thing. *Do you need to be guided from A to B to C now?
What sort of misplaced hubris is this? And perhaps you have never
seen a Web page with a form at the bottom. If possible (e.g. script,
CSS and any other needed features are available), the author may
choose to adjust the style to hide the form. It could then be
displayed later in response to a button press. The poor Lynx users
will just have to look at the form at the bottom. Again, so what?
Oct 22 '08 #10

P: n/a
David Mark wrote:
Thomas 'PointedEars' Lahn wrote:
>David Mark wrote:
>>Thomas 'PointedEars' Lahn wrote:
David Mark wrote:
Thomas 'PointedEars' Lahn wrote:
>dhtml wrote:
>>rf wrote:
>>>"GArlington" wrote:
>>>On Oct 20, 10:45 am, MartinRineh...@gmail.com wrote:
>>>>I can load a dialog by loading an HTML page or by constructing the
>>>>dialog with JavaScript.
>>>>What should I be thinking about when I look at this choice?
>>[...]
>>Loading it in HTML does not necessitate an extra http req. Just put it
>>in the HTML. Requires less javascript to be downloaded.
>>...
>><body>
>><h1Heading </h1>
>><pyour content here </p>
>><div id="panel">
>> panel content here.
>></div>
>></body>
>>...
>You forgot to consider non-graphical user agents, including text browsers
>(which usually do not support CSS) and search engines.
True enough, you should always test pages in Lynx (or a simulator) for
just this reason (most pages will read like the gibberish that they
are.)
However, the quoted example would be fine in this regard, [...]
Isn't it obvious that it would not be fine? The panel is a dialog that
No.
Apparently not to you (yet).
>>>should only be displayed when necessary (requested by a user action).
Not necessarily. That may not be possible.
It is entirely possible if the dialog is not in the original HTML document.
Have you even read the thread?

Of course I have. There is exactly one post by the OP and the problem
is outlined in one vague sentence. Perhaps you had a different
interpretation?
There is nothing that needs interpretation here. Apparently you do need to
be guided from A to B to C (and D). So be it.

(A) The OP was asking himself (and the participants of this newsgroup) what
would be the best way to load (read: display) a dialog. The
alternatives that he saw were a) loading a HTML document ("page") or b)
constructing the dialog with JavaScript (sic!).

(B) "GArlington" said that if the OP loaded a HTML document another request
to the Web server was necessary. "rf" also emphasized that a dialog
that only worked with "JavaScript" would not be interoperable.

However, "dhtml" suggested that it would be possible to avoid another
request if the dialog was included in the original HTML document.

(C) I pointed out that there are commonly used user agents that do not
support CSS (among them search engines) and therefore would not hide
the dialog (which cannot be shown if it is to be *loaded*, in the
common sense of the word). That would mean that the solution suggested
by "dhtml" would therefore not be a viable one.

(D) You jump in and say that despite the facts I pointed out the example
that included the dialog in the original HTML would be fine in that
regard, which is obviously a contradiction. When confronted with
an explanation why it is not fine, you insist and state that it may
not be possible to prevent the *form* from being there although it
is obvious that this is another contradiction; it was established
before that it is entirely possible to display the form or whatever
only on demand.
>>>However, with this markup the "panel" will be displayed always (as a
paragraph) in e.g. Lynx.
Yes, Lynx does not support script. That's why the form will always be
there. So what?
So there would be a dialog (not a form) that does not belong there, which

The word "dialog" has no real meaning here. A form in a div?
A dialog is merely a part of an application that requests input from a user,
usually triggered *on their request* (by a menu item, button or another
widget). That derives from the original meaning of the word in the sense
that the computer talks to the user (e.g. asks a question) and vice-versa
("OK" or "Yes" would mean "yes" or "acknowledged"). A dialog clearly does
not need to be a form.
>would be a Bad Thing. Do you need to be guided from A to B to C now?

What sort of misplaced hubris is this? And perhaps you have never
seen a Web page with a form at the bottom. [...]
Apparently you are unable to place proper meaning on the word *d*i*a*l*o*g*
in a GUI. A sad thing for sure, and a reason for worries if you would
develop such applications, but your problem alone.
Score adjusted

PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Oct 23 '08 #11

P: n/a
On Oct 23, 3:40*pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
[snip]
>
The word "dialog" has no real meaning here. *A form in a div?

A dialog is merely a part of an application that requests input from a user,
usually triggered *on their request* (by a menu item, button or another
Thanks, professor. The operative word is *usually*. Certainly not
even close to always (see below.)

[snip]
>
Apparently you are unable to place proper meaning on the word *d*i*a*l*o*g*
For example, the first thing most users see on running new software
(hint: like opening a Web page) is a registration *d*i*a*l*o*g*.

Idiot.
Oct 23 '08 #12

P: n/a
David Mark wrote:
Thomas 'PointedEars' Lahn wrote:
[snip]
>>The word "dialog" has no real meaning here. A form in a div?
A dialog is merely a part of an application that requests input from a user,
usually triggered *on their request* (by a menu item, button or another

Thanks, professor. The operative word is *usually*. Certainly not
even close to always (see below.)

[snip]
>Apparently you are unable to place proper meaning on the word *d*i*a*l*o*g*

For example, the first thing most users see on running new software
(hint: like opening a Web page) is a registration *d*i*a*l*o*g*.
That is commonly called a registration *form*. Obviously _not_ what the OP
wants. He wants to *load* a *dialog* instead *from another HTML document*.
Idiot.
When unreasonable people run out of arguments, they can only but get personal.

<http://en.wikipedia.org/wiki/Dialog_box>
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Oct 24 '08 #13

P: n/a
David Mark wrote:
On Oct 22, 6:20 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
>David Mark wrote:
>>Thomas 'PointedEars' Lahn wrote:
David Mark wrote:
Thomas 'PointedEars' Lahn wrote:
>dhtml wrote:
>>rf wrote:
>>>"GArlington" wrote:
>>>On Oct 20, 10:45 am, MartinRineh...@gmail.com wrote:
What sort of misplaced hubris is this? And perhaps you have never
seen a Web page with a form at the bottom. If possible (e.g. script,
CSS and any other needed features are available), the author may
choose to adjust the style to hide the form. It could then be
displayed later in response to a button press. The poor Lynx users
will just have to look at the form at the bottom. Again, so what?
Putting it at the bottom would be a lot simpler than setting up XHR to
get the panel HTML.

For all we know, the OP is not deploying this on a public domain.

Garrett

--
comp.lang.javascript FAQ <URL: http://jibbering.com/faq/ >
Oct 24 '08 #14

P: n/a
On Oct 24, 8:35 am, dhtml wrote:
<snip>
For all we know, the OP is not deploying this on a public
domain.
We do have the default assumption rule, where either we do know that
the OP is not deploying this on a public domain (as a result of being
told as much) or (in the absence of information) assume that it is.

Richard.
Oct 24 '08 #15

This discussion thread is closed

Replies have been disabled for this discussion.