473,480 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Is basic crapola the norm for describing how to implement JS?

<begin rant>

I am so damn sick and tired of seeing how NOT to use document.write() it's
driving me frickin nuts.

This is OUR explanation of document.write().
document.write("hello idiot")
document.write(<p>)
document.write(<tr>)

I mean come on. Why do I need to use javascript to write html tags?
Let alone simple plain text messages?

This is not the purpose of document.write().
It's purpose is to allow the user to write to the document meaningful output
as defined in various statements within the ().
Such as document.write(a+b+c-x).

Some of these good minded jackasses even take it a bit further and show:
<h2>some text</h2>
<script> <<< shortened on purpose ok?
document.write(<p>)
</script>

I kid you not.

And of course, I've seen examples of a short simple paragraph explaining
what it is and a dozen ads surrounding it.

I swear, some people are putting up pages just to get hits so the
advertisers pay them more.

< end rant>
Jul 23 '05 #1
4 1024
In article <ct*********@news3.newsguy.com>, An*******@127.001 says...
<begin rant>

I am so damn sick and tired of seeing how NOT to use document.write() it's
driving me frickin nuts.

This is OUR explanation of document.write().
document.write("hello idiot")
document.write(<p>)
document.write(<tr>)

I mean come on. Why do I need to use javascript to write html tags?


You don't. However, the code you've copied may do it. There are
perfectly valid reasons for doing that sort of this, RtS. See if you
can think of anything, dum-dum.

--
Hywel http://kibo.org.uk/
I do not eat quiche.
Jul 23 '05 #2
On Mon, 24 Jan 2005 07:22:25 -0000 Hywel Jenkins wrote:
In article <ct*********@news3.newsguy.com>, An*******@127.001 says...
<begin rant> I am so damn sick and tired of seeing how NOT to use document.write()
it's
driving me frickin nuts. This is OUR explanation of document.write().
document.write("hello idiot")
document.write(<p>)
document.write(<tr>) I mean come on. Why do I need to use javascript to write html tags?
You don't. However, the code you've copied may do it. There are
perfectly valid reasons for doing that sort of this, RtS. See if you
can think of anything, dum-dum.


I understand it is shown for demonstration purposes, but can somebody please
get an original idea?
It's like one person wrote the thing, and 10,000 others copied it.
While none of them truly explain the purpose or how else it may be used.
Jul 23 '05 #3
In article <ct*********@news3.newsguy.com>, An*******@127.001 says...
On Mon, 24 Jan 2005 07:22:25 -0000 Hywel Jenkins wrote:
In article <ct*********@news3.newsguy.com>, An*******@127.001 says...
<begin rant> I am so damn sick and tired of seeing how NOT to use document.write()
it's
driving me frickin nuts. This is OUR explanation of document.write().
document.write("hello idiot")
document.write(<p>)
document.write(<tr>) I mean come on. Why do I need to use javascript to write html tags?

You don't. However, the code you've copied may do it. There are
perfectly valid reasons for doing that sort of this, RtS. See if you
can think of anything, dum-dum.


I understand it is shown for demonstration purposes, but can somebody please
get an original idea?


Well, duh.

--
Hywel http://kibo.org.uk/
I do not eat quiche.
Jul 23 '05 #4
"Richard" <An*******@127.001> wrote in message
news:ct*********@news3.newsguy.com...
On Mon, 24 Jan 2005 07:22:25 -0000 Hywel Jenkins wrote:
In article <ct*********@news3.newsguy.com>, An*******@127.001 says...
<begin rant> I am so damn sick and tired of seeing how NOT to use
document.write()
it's
driving me frickin nuts. This is OUR explanation of document.write().
document.write("hello idiot")
document.write(<p>)
document.write(<tr>) I mean come on. Why do I need to use javascript to write html tags?

You don't. However, the code you've copied may do it. There are
perfectly valid reasons for doing that sort of this, RtS. See if you
can think of anything, dum-dum.


I understand it is shown for demonstration purposes, but can somebody
please
get an original idea?
It's like one person wrote the thing, and 10,000 others copied it.
While none of them truly explain the purpose or how else it may be
used.


Because the output of document.write() depends on JavaScript being
enabled, you can use document.write() to control the content of your
page that may depend on javascript:

<body onload="blah(false);">
<form name="myForm">
<script type="text/javascript">
document.write(
'<input type="checkbox"' +
' name="myCheckbox"' +
' onclick="blah(this.checked);">' +
' Additional comments'
);
function blah(b)
{
var el;
if (document.getElementById &&
(el = document.getElementById('myAdditionalComments')) &&
(el = el.style) &&
'string' == typeof el.display)
{
el.display = b ? '' : 'none';
return el.display = b ? '' : 'none';
}
}
</script>
<input type="text" id="myAdditionalComments" name="additionalComments">
</form>

While you may not be able to infer that document.write() working means
the browser also supports document.getElementById, or the ability to
dynamically change an element's display style, you are guaranteed that
in the absense of JavaScript, you will never get a checkbox that does
nothing.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #5

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

Similar topics

6
1779
by: dan glenn | last post by:
PHP4.3.2, GD2 - I have found to my great dismay and consternation that if I load a jpg image , then save it as a PNG, the resulting PNG will actually work in a browser, but it can't be loaded again...
1
3194
by: Lucas Raab | last post by:
Can I use Python as an extension language to Visual Basic sort of like in C or C++?
7
9256
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
2
2520
by: Norm | last post by:
I have run into problems from time to time (and this is one of those times) using visual basic to access an external database and perform a basic select from statement. When the table is extremely...
28
1645
by: Intermouse | last post by:
I have recently purchased an aspi wrapper control for vb. I haven't had much experience with hex and memory addresses and that's my problem. The piece of code that baffles me is: With ASPI1...
2
1249
by: Hazzard | last post by:
If I have two assemblies in a VSNET project and create an interface, does the interface have to reside in the assembly whose class methods it describes? How do I reference interfaces in the...
4
1277
by: Mark Linehan | last post by:
Greetings and salutations. I began programming God knows how many years ago in basic on the Commodore 64. I dabbled in a little assembly as well. I moved on to the PC eventually and stuck with...
3
15762
by: Martin | last post by:
How does one set up basic authentication on an HttpListener? I know I need to set the HttpListener.AuthenticationSchemes to AuthenticationSchemes.Basic but then I'm unsure how and against what...
4
1708
by: MikeB | last post by:
I've been all over the net with this question, I hope I've finally found a group where I can ask about Visual Basic 2005. I'm at uni and we're working with Visual Basic 2005. I have some books, ...
3
2028
by: Simon Hart | last post by:
Hi, I am trying to implement some functionality as seen in MS CRM 3.0 whereby a basic Xml is deserialized into an object which contains properties. What I want to do from here is; cast the basic...
0
7041
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
6908
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
7043
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,...
1
6737
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
5336
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,...
0
4481
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...
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
179
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...

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.