469,304 Members | 1,888 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,304 developers. It's quick & easy.

writing to a page

is it possible to write text into a page or does the whole page have to be
re written using Document.Write?
I'm an absolute beginner and wanted to add lines of text when a button is
clicked. the only references i can find are to text boxes or alerts. if I
use Document.Write the page changes to hiving only the text I wrote so do I
have to rewrite the whole page into the script. Could be a long job.
Jul 20 '05 #1
7 1502
In article <jU*******************@news-lhr.blueyonder.co.uk>, iz0nlee
<iz*****@blueyonder.com> wrote:
is it possible to write text into a page or does the whole page have to be
re written using Document.Write?
I'm an absolute beginner and wanted to add lines of text when a button is
clicked. the only references i can find are to text boxes or alerts. if I
use Document.Write the page changes to hiving only the text I wrote so do I
have to rewrite the whole page into the script. Could be a long job.


You can write to an iFrame as I do on my Amtrak page.

See http:www.dcs-chico.com/~denmarks/amtrak.html

-- in body
<iframe src="initial page to display - optional" name="framename"
height="?" width="?" scrolling="auto">This text will appear if iframe
is not supported</iframe>

-- in a script
iFrameWindow=frames["framename"];
iFrameWindow.document.open();
iFrameWindow.document.write("This is the text");
iFrameWindow.document.close();

--
Dennis M. Marks
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #2
In article <jU*******************@news-lhr.blueyonder.co.uk>, "iz0nlee"
<iz*****@blueyonder.com> writes:
is it possible to write text into a page or does the whole page have to be
re written using Document.Write?
Yes. Its what dHTML is all about. Thats assuming you mean document.write and
not Document.Write (javascript is case sensitive)
I'm an absolute beginner and wanted to add lines of text when a button is
clicked. the only references i can find are to text boxes or alerts. if I
use Document.Write the page changes to hiving only the text I wrote so do I
have to rewrite the whole page into the script. Could be a long job.


http://www.jibbering.com/faq/#FAQ4_15
--
Randy
Jul 20 '05 #3
JRS: In article <14*************************@dcsi.net>, seen in
news:comp.lang.javascript, Dennis M. Marks <de******@dcsi.net> posted at
Sun, 14 Dec 2003 15:37:10 :-
In article <jU*******************@news-lhr.blueyonder.co.uk>, iz0nlee
<iz*****@blueyonder.com> wrote:
is it possible to write text into a page or does the whole page have to be
re written using Document.Write?
I'm an absolute beginner and wanted to add lines of text when a button is
clicked. the only references i can find are to text boxes or alerts. if I
use Document.Write the page changes to hiving only the text I wrote so do I
have to rewrite the whole page into the script. Could be a long job.


You can write to an iFrame as I do on my Amtrak page.

See http:www.dcs-chico.com/~denmarks/amtrak.html

-- in body
<iframe src="initial page to display - optional" name="framename"
height="?" width="?" scrolling="auto">This text will appear if iframe
is not supported</iframe>

-- in a script
iFrameWindow=frames["framename"];
iFrameWindow.document.open();
iFrameWindow.document.write("This is the text");
iFrameWindow.document.close();


You could give better-informed answers by familiarising yourself with
the FAQ *before* answering. This one is 4.16.
OP : <URL:http://www.merlyn.demon.co.uk/js-valid.htm#VFF> provides an
example of this, if you make at least one entry wrong (e.g. blank)
before pressing an FTry button.

<URL:http://www.merlyn.demon.co.uk/js-other.htm#RWP> refers;
<URL:http://www.merlyn.demon.co.uk/js-tests.htm#DynTest> demonstrates.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> Jsc maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/Jsc/&c, FAQ topics, links.
Jul 20 '05 #4
@SM
"Dennis M. Marks" a ecrit :
You can write to an iFrame as I do on my Amtrak page.
unluck
my NC 4.5 can't read iframes !
how will he (you) show me his (yours) lines ?
See http:www.dcs-chico.com/~denmarks/amtrak.html


You'll have to double with a layer, if you use this way
--
************************************************** ************
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr

Jul 20 '05 #5
@SM
Dr John Stockton a ecrit :
You could give better-informed answers by familiarising yourself with
the FAQ *before* answering. This one is 4.16.
Wich FAQ ?

Is it somewhere in one of urls below ?
OP : <URL:http://www.merlyn.demon.co.uk/js-valid.htm#VFF> provides an
example of this, if you make at least one entry wrong (e.g. blank)
before pressing an FTry button.

<URL:http://www.merlyn.demon.co.uk/js-other.htm#RWP> refers;
<URL:http://www.merlyn.demon.co.uk/js-tests.htm#DynTest> demonstrates.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> Jsc maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/Jsc/&c, FAQ topics, links.


--
************************************************** ************
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr

Jul 20 '05 #6
"@SM" <st**************@wanadoo.fr> wrote in message
news:3F**************@wanadoo.fr...
You could give better-informed answers by familiarising
yourself with the FAQ *before* answering. This one is 4.16.
Wich FAQ ?


The comp.lang.javascript FAQ of course.
Is it somewhere in one of urls below ?


Yes:-

<snip>
<URL: http://jibbering.com/faq/ > Jim Ley's
FAQ for news:comp.lang.javascript

<snip>

It is also automatically posted to the group on a fairly regular basis,
I am surprised that you have missed it, especially as it has come in for
an unusual amount of comment in the last week.

Richard.
Jul 20 '05 #7
@SM wrote on 15 Dec 2003 at Mon, 15 Dec 2003 23:49:32 GMT:
Dr John Stockton a ecrit :
You could give better-informed answers by familiarising
yourself with the FAQ *before* answering. This one is 4.16.


Wich FAQ ?

Is it somewhere in one of urls below ?


Yes: <URL:http://jibbering.com/faq/>

Jim Ley's FAQ for news:comp.lang.javascript

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk")
Jul 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Google Mike | last post: by
2 posts views Thread by Troy Lynch | last post: by
7 posts views Thread by Brian Burgess | last post: by
6 posts views Thread by Jeff Thies | last post: by
385 posts views Thread by Xah Lee | last post: by
17 posts views Thread by Eric Lindsay | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.