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

Rodney Myers rmyers at i-way.co.uk
Sun Mar 25 03:42:04 CST 2001


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




More information about the Javascript mailing list