[Javascript] Writing to Document after a function is executed.

Reuben D Budiardja reubendb at goshen.edu
Sun Mar 25 11:18:30 CST 2001


First, thanks for the respond.

I see your point (I think). But, I think it's ok if it overwrite, the 
current document. I tried to write into a form input, but I don't really 
want to do that, for aesthetic reason. What I really want is to eventually 
write all the contain of the array to a table using "for loop", one row for 
each element.

The example that I give previously was not the best way to illustrate it. 
What I want is that everytime I type something in my text input box, and 
hit enter, the text will be added as one new element of the array, and at 
the end of the page, .document.writeln will write everything in the array 
into a row of the table.

This idea is mainly for speed reason. Eventually, I want to submit 
everything into a database, using server side scripting language (such as 
php). But, I don't want the page to reload everytime I input something into 
my text box, before it can be displayed (the pitfall of server side 
language). That's why I'd like to use javascript. Any help on how I can do 
this will be much appreciated.

So, a frame might be a good idea, but I'm trying to avoid it. I'm using 
mainly NN, so I need a cross browser compatibility. Could you point me as 
to how can I write into specific table cells?

Thanks a lot.
Reuben D. Budiardja

At 10:42 AM 3/25/01 +0100, Rodney Myers wrote:
>Reuben,
>
>Writing to the document after it has loaded client side will give very
>'mixed' results. It may succeed in MSIE but in NN it will certainly
>overwrite the current document. Since your code is contained in that
>same current document that will be a problem.
>
>You can write into a form input, a frame, or (perhaps using a
>cross-browser compatible DHTML script) a layer.
>
>Using the MSIE DOM you can write into specific table cells (for example)
>using their ID.
>
>hth
>
>Rodney
>
>Reuben D Budiardja wrote:
> >
> > Hello,
> > I just joined the list. I'm a newbie in using Javascript as scripting
> > language. So far I have been using a server side scripting language, so, my
> > frame of thinking is a bit different, and I'm still kinda confused when
> > using client side language such as javascript.
> >
> > I have the following question.
> > I want to write to the document, after some function is executed. In
> > that function, I want to manipulate the string I want to write. So,
> > basically can I do something like this:
> >
> > <SCRIPT>
> > functing bla()
> > {
> > var colors = new Arrays("Yellow", "blue", "red");
> > }
> > <SCRIPT>
> >
> > <FORM>
> > <INPUT TYPE="Text" onChange="bla();">
> > </FORM>
> >
> > <SCRIPT>
> > document.writeIn(colors[0])
> > </SCRIPT>
> >
> > This always give me an undefined error. Any help on this will be
> > greatly appreciated.
> > Thanks
> > Reuben D. Budiardja
> >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > http://www.LaTech.edu/mailman/listinfo/javascript
>
>--
>Shop at ssistant Add-ons and Developer Workshops
>http://www.aflyingstart.net/addons/
>STILL PLACES OPEN on Fri 27 April workshop
>
>Courses in April
>Mon 23  : Making a Start in E-Commerce with Shop at ssistant
>Tue 24  : Meeting Business Needs with the Shop at ssistant Classic system
>Wed 25 : Building Better Shopping Pages with Shop at ssistant Classic
>
>
>Booking for these Shop at ssistant Classic courses at
>http://www.shopassistant.net/training/
>Or call 01256 880770
>
>Rodney Myers
>Based in Oxford, England
>Technical Director, Shop at ssistant eCommerce Solutions
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>http://www.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list