insert text dynamically into textarea

C

cyprian

how do i use javascript function to dynamically insert text into
textarea from the result of an array comparison expression. read the
dom but found no way out.
thanks
 
O

One Dumm Hikk

Regardless of what it is a result of, you can set the value property of the
textarea element.


Try looking up "createTextNode" and "appendChild."

Why would you suggest looking up createTextNode and appendChild in
order to set the .value property of a Form Element?

document.formID.textAreaName.value = "something new";

Trivial stuff, don't make it harder than it has to be.
 
D

David Mark

One said:
Why would you suggest looking up createTextNode and appendChild in
order to set the .value property of a Form Element?

I suggested the value property first. He said he could find no DOM
equivalent, so I enlightened him on those methods too.
document.formID.textAreaName.value = "something new";

Trivial stuff, don't make it harder than it has to be.

--
Randy
Anybody that serves XHTML on the web
has an IQ just above the shoe size of
a 2 year old infant.

That's silly. Does that include the W3C? There is no way I would
store content on a Web server locked up in HTML. Nor would I make the
server work to transform every page into HTML on-the-fly. So there is
only one solution that I see: serve XHTML as XML to those browsers
that can understand it and send it as text/html to IE. Works fine for
me.
 
D

David Mark

David Mark said the following on 7/20/2007 2:54 PM:



While you may consider it "silly", it is true.


If the W3C tries to pass of XHTML to IE, then yes they are lacking in
the IQ area as well.


There is no way *I* would store XHTML on a web server since 90% or so of
the web doesn't know what it is.

IE does fine with it, despite not knowing what it is. And I have read
that IE8 will have an XML parser. I am sure you understand the value
of having content in XML as most of the Web understands RSS (for
example.)
Who said anything about transforming pages? It is simple:

That is a standard argument of XHTML detractors. They can't deny that
XML has benefits, so they suggest transforming it to HTML to send to
browsers.
Write HTML4.01
Serve it as text/html
Script it with an HTML DOM

What's the problem? XHTML is a dead language. Even the W3C gave up on it
and moved on to HTML5.

I don't agree with you there. They haven't announced any such thing
and their own site is XHTML.
Then you are not scripting a true XHTML document in non-IE browsers and
having that same script execute in IE unless it is a trivially simple
script.

Sure I am. I have an entire application framework that works
efficiently in both modes. I went over that with another XHTML
detractor in a recent thread.
 
D

David Mark

David Mark said the following on 7/21/2007 3:41 PM:



If you consider IE having to parse it as tag soup and then trying to
make sense of the resulting DOM "fine with it".....


They said that about IE7...
They said that about IE6...

As I understand it, it just missed the cut in IE7.
The last I read from MS about XHTML was that it simply wasn't worth the
effort to support it for the small benefit it offers over HTML4.01 Strict.

That sounds like a turn of the century quote to me.
And you have not seen me say differently. We are not discussing XML, we
are discussing XHTML and - directly - it's use as a language on the Web.

As I am sure you know, XHTML is XML. That's the whole point. Just
like RSS and XHTML Basic are XML. You can easily transform one flavor
into another, but you can't efficiently transform HTML into anything
useful.
You have, sadly, mistaken me for an XHTML detractor. It has it's
benefits, just not for the WWW in general.

Okay. An "XHTML on the Web" detractor.
It only takes common sense to figure it out.

Figure what out? The w3c has never said that HTML 5 is a replacement
for XHTML 2. They are two different initiatives with completely
different goals.
Once again, you have - mistakenly - assumed I am an "XHTML detractor"
when that is not true. I just know it is a mistake to put it on the Web
for an audience where 80+% of the clients don't know what it is.

IE doesn't know what it is technically, but it renders it just fine.
It seems to me that the real concern of the "XHTML is harmful on the
Web" crowd is that 90% of the authors don't know what it is. But that
is not my concern.
 
D

David Mark

David Mark said the following on 7/22/2007 2:00 PM:







They said that about IE6.... But no, it didn't "just miss the cut".



Actually, it is somewhere in the MSDN Blogs that were being written at
the time that IE7 was Beta or about to become public. I will keep
looking for the link again. It was written, I believe, by Peter Torr
(don't quote me on the name) but it was an MS rep. I trust him more than
a Usenet Poster.



That is why I don't store static HTML. To do that is idiotic if you want
to transform it.

So what do you store then? I assume XML, which would mean your server
has to transform it to HTML with each request.
Yippeeeeee, I have another phrase attached to me. Granted, it is nicer
than a lot of the ones attached to me.



If you have to ask that......

You seem to have trailed off.
Who said any differently?

You said XHTML was dead and the w3c has "moved on" to HTML 5 and asked
the reader to "figure it out." So what were you implying>
Depends on your definition of "just fine" and how complex the page is.

FWIW, I primarily write Web applications and they get a lot more
complex than the average Web page (ie if I can make it work, then it
is more than suitable for the Web in general.)

I've seen many sites just like it. That particular one seems outdated
as it warns about Opera 7, which prefers HTML (not a problem if you
negotiate properly.) The latest Opera browsers prefer XHTML.
 
D

David Mark

David Mark said the following on 7/22/2007 7:09 PM:







Actually, there are very very few HTML files on the Intranet server that
I use. Most of the data is stored in a database and creates .js files on
the fly. Everything in the system was designed with two things in mind -
speed and server load. The more I can make the client machine do then
the less my server has to do. Switching to the current back end system
(the front end looks almost identical to the old version) took almost 3
years and more hours of work than I care to remember. It has sped up my
Intranet almost 10-fold by moving the processing load from the server to
the client machine.

What do JS files have to do with the XHTML vs. HTML discussion?
The public website is slowly being migrated to the same system of using
.js files loaded on the fly. I have found it to be simpler, more
reliable, and quicker than trying to make XHR requests and deal with the
response. The major issue with the website being migrated is the lack of
support and problems with loading .js files on mac platforms and some of
the older legacy PC browsers. If, and when, the support becomes more
available on mac browsers and the legacy PC browsers are finally dead
and gone, the website will be switched to the same system as well.

As for transforming XML to HTML, you might try looking at the
process.wsf file and the index.xml file that is used to create this very
groups FAQ. Edit the xml file, run the process.wsf file, and it creates
the HTML file on the fly for you. So no, I don't buy into the "Its
easier to transform XML to XHTML than HTML" argument.

That wasn't my argument. Of course you transform XML into HTML. What
is silly is transforming XHTML into HTML, when you could just send the
XHTML.
While it is slightly outdated, the only information on that page that is
still outdated is indeed the warning about Opera 7. The other issues
that it brings up are still valid issues for not serving XHTML on the
web though. If you want to serve XHTML on the web, by all means do so.
Just don't expect to push it here in comp.lang.javascript without being

I don't push anything in here. I think the original discussion arose
from some silly tag line of yours that insulted anyone and everyone
who used XHTML on the Web. So don't expect to do that without being
challenged. Or perhaps you can as I am growing weary of this whole
argument.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top