473,399 Members | 2,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

HTML or JavaScript

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
14 1653
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
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
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
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
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: quikquic | last post by:
Suppose I download a html file with javascript in it, for example, <html> <body> <script language="JavaScript"> document.write("Hello"); </script> </body> </html>
7
by: quikquic | last post by:
If there is javascript in a html file, for example, <html> <body> <script language="JavaScript"> document.write("Hello"); </script> </body> </html>
9
by: Robby Bankston | last post by:
I'm working on some code and am running into brick walls. I'm trying to write out Javascript with Javascript and I've read the clj Meta FAQ and didn't see the answer, read many similar posts (with...
6
by: Jon Davis | last post by:
I recently learned how to do an <OBJECT> alternative to <IFRAME> in current browsers using: <object id="extendedhtml" type="text/html" data="otherpage.html" width="250" height="400"></object> ...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
10
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario -------------...
1
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot...
7
by: imtmub | last post by:
I have a page, Head tag Contains many Scripts and style sheet for Menu and Page. This code working fine and displaying menus and page as i wanted. Check this page for reference....
42
by: Santander | last post by:
how to decode HTML pages encoded like this: http://www.long2consulting.com/seeinaction2008/Simplicity_Beach_table/index.htm Is there script that will do this automatically and generate normal fully...
3
by: happyse27 | last post by:
Hi All, I am creating the perl script using html form(with embedded javascript inside). When using this html form with javascript alone, it works where the form validation will pop up...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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
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
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,...

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.