Computer Science Canada

document.write without deleting previous output

Author:  tupac [ Wed Feb 27, 2008 12:43 pm ]
Post subject:  document.write without deleting previous output

I'm working on a website partly using javascript, but when i use 'document.write("something")' the output shows up as text, and all the pictures and text before it is deleted. Is there any way to "add" text using javascript to the website without deleting previous work?

Thanks

Author:  OneOffDriveByPoster [ Wed Feb 27, 2008 12:49 pm ]
Post subject:  Re: document.write without deleting previous output

tupac @ Wed Feb 27, 2008 12:43 pm wrote:
Is there any way to "add" text using javascript to the website without deleting previous work?
Check out Document Object Model or DOM.

Author:  Tony [ Wed Feb 27, 2008 1:09 pm ]
Post subject:  RE:document.write without deleting previous output

OneOffDriveByPoster is right, you've got to be familiar with DOM if you plan on doing any on-page manipulations with JavaScript.

Also: firebug and prototype js (or equivalent).

Author:  tupac [ Wed Feb 27, 2008 3:02 pm ]
Post subject:  Re: document.write without deleting previous output

Thanks for all the help, I got my site to do what its supposed to =).


: