470,594 Members | 1,412 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

document.write(var) include


<script language="JavaScript">
<!--
document.write('<form name="combo"><select name="example" size="1
onChange="Draw()">');
document.write('<option value=none>Maak je keuze');
document.write('<option value=none>--------------------');
document.write('<option value="een">Trend 1');
document.write('<option value="twee">Trend 2');
document.write('<option value="drie">Trend 3');
document.write('</select>');
document.write('</form>');
//-->
</script>
</div>
<div style="POSITION: absolute; TOP: -70px;" align="center" >
<SCRIPT Language="JavaScript">
function Draw() {
i
(document.combo.example.options[document.combo.example.selectedIndex].valu
!= "none") {
var tre = "<!--" + "# include VIRTUAL=/usr/"
document.combo.example.options[document.combo.example.selectedIndex].valu
+ ".txt -->" ;
alert(tre)
venster = window.open("","","width=400,height=600");
venster.document.write(tre);

}
</SCRIPT>

men! whats wrong.. venster.document.write(tre) do not wor

hijwe
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message35833.htm

Jul 20 '05 #1
5 7157
hijwel wrote:

<script language="JavaScript">
<!--
document.write('<form name="combo"><select name="example" size="1"
onChange="Draw()">');
document.write('<option value=none>Maak je keuze');
document.write('<option value=none>--------------------');
document.write('<option value="een">Trend 1');
document.write('<option value="twee">Trend 2');
document.write('<option value="drie">Trend 3');
document.write('</select>');
document.write('</form>');
//-->
</script>
</div>
<div style="POSITION: absolute; TOP: -70px;" align="center" >
<SCRIPT Language="JavaScript">
function Draw() {
if
(document.combo.example.options[document.combo.example.selectedIndex].value != "none") {
var tre = "<!--" + "# include VIRTUAL=/usr/" +
document.combo.example.options[document.combo.example.selectedIndex].value
+ ".txt -->" ;
alert(tre)
venster = window.open("","","width=400,height=600");
venster.document.write(tre);

}
</SCRIPT>

men! whats wrong.. venster.document.write(tre) do not work


Yeah, tell us: What is wrong?
It doesn't look wrong to me, but of course I cannot see the values in your
radiobuttons.

What makes you say that the content:
<!-- # include VIRTUAL=/usr/blabla.txt -->
is not written away to venster-window?
Maybe it is working and the behaviour the include (which is NOT javascript
by the way, AFAIK) is not what you expect.
I think the line you write does nothing.

If you want javascript to include something, try this:
<SCRIPT SRC="/usr/blabla.js"></SCRIPT>

If you want to execute something SERVERSIDE (SSI), it won't work writting it
to a fresh window, because no server is involved.
Regards,
Erwin Moller
Jul 20 '05 #2

thx..

how can i write in the same document?

document.write

hijwe
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message35833.htm

Jul 20 '05 #3
hijwel wrote:

thx..

how can i write in the same document?

document.write?
Hi hijwel.

yes.

But you have to provide all the information you write via Javascript.
Warning: If you decide to use document.close() and you reopen the document,
the page will be rebuild from their. So take care.

If you need anything that is stored on the server you have to use a
scriptinglanguage, like PHP/Perl/ASP/etc.

PHP example:

example.php
----------------------------------
<html>
<body>
Hello, I am Dutch too!
<br>
Here follows an include named myIncludes/someinclude.php:
<br>
<?php include 'myIncludes/someinclude.php'; ?>
<br>
Here follows javascript writing to the document:
<br>

<script type="text/javascript">
document.write("This is javascript writing!");
</script>

</body>
</html>

----------------------------------

Hopelijk helpt dit. :-)

Succes!

Groetjes,
Erwin Moller


hijwel
------------------------------------------------------------------------
Posted via http://www.forum4designers.com
------------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message35833.html


Jul 20 '05 #4
hijwel wrote:
------------------------------------------------------------------------
Posted via http://www.forum4designers.com
------------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message35833.html

Do you realize that you are not posting to a webiste forum when you use
this site. They are passing your posts on to the usenet newsgroup
comp.lang.javascript

comp.lang.javascript is a publicly available newsgroup. The website you
are using is stealing its content directly from there and pretending
that it is their own. There is no original material at all on the
website you are looking at now. It is all coming directly from usenet.

I suggest you obtain a newsreader and visit us at
news:comp.lang.javascript - you will get a far better reaction to your
question there.
--
Randy
Chance Favors The Prepared Mind
Copied from Richards Post

Jul 20 '05 #5
JRS: In article <hi***********@mail.forum4designers.com>, seen in
news:comp.lang.javascript, hijwel <hi***********@mail.forum4designers.co
m> posted at Thu, 22 Jan 2004 06:10:15 :-
thx..
how can i write in the same document?


You can find out how to do that by reading the newsgroup FAQ, and by
reading the newsgroup itself before posting.

This is an Usenet newsgroup, not a Web service; you need to understand
what you are doing here, and to comply with accepted norms.

Whenever anyone is introduced to Usenet news, in whatever form it is
presented, their attention should be firmly drawn to the FAQ system,
which is intended to obviate the continued presentation of well-known
questions.

--
© John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Andrew V. Romero | last post: by
6 posts views Thread by Mike Daniel | last post: by
13 posts views Thread by Stumped and Confused | last post: by
2 posts views Thread by key9 | last post: by
3 posts views Thread by windandwaves | last post: by
8 posts views Thread by johnsonlau | last post: by
1 post views Thread by Jean | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.