By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,712 Members | 2,111 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,712 IT Pros & Developers. It's quick & easy.

writing to a page

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
@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

P: n/a
@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

P: n/a
"@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

P: n/a
@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.