document.write(var) include

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hijwel

    document.write(var) include


    <script language="JavaS cript">
    <!--
    document.write( '<form name="combo"><s elect name="example" size="1
    onChange="Draw( )">');
    document.write( '<option value=none>Maak je keuze');
    document.write( '<option value=none>--------------------');
    document.write( '<option value="een">Tre nd 1');
    document.write( '<option value="twee">Tr end 2');
    document.write( '<option value="drie">Tr end 3');
    document.write( '</select>');
    document.write( '</form>');
    //-->
    </script>
    </div>
    <div style="POSITION : absolute; TOP: -70px;" align="center" >
    <SCRIPT Language="JavaS cript">
    function Draw() {
    i
    (document.combo .example.option s[document.combo. example.selecte dIndex].valu
    != "none") {
    var tre = "<!--" + "# include VIRTUAL=/usr/"
    document.combo. example.options[document.combo. example.selecte dIndex].valu
    + ".txt -->" ;
    alert(tre)
    venster = window.open("", "","width=400,h eight=600");
    venster.documen t.write(tre);

    }
    </SCRIPT>

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

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

  • Erwin Moller

    #2
    Re: document.write( var) include

    hijwel wrote:
    [color=blue]
    >
    > <script language="JavaS cript">
    > <!--
    > document.write( '<form name="combo"><s elect name="example" size="1"
    > onChange="Draw( )">');
    > document.write( '<option value=none>Maak je keuze');
    > document.write( '<option value=none>--------------------');
    > document.write( '<option value="een">Tre nd 1');
    > document.write( '<option value="twee">Tr end 2');
    > document.write( '<option value="drie">Tr end 3');
    > document.write( '</select>');
    > document.write( '</form>');
    > //-->
    > </script>
    > </div>
    > <div style="POSITION : absolute; TOP: -70px;" align="center" >
    > <SCRIPT Language="JavaS cript">
    > function Draw() {
    > if
    >[/color]
    (document.combo .example.option s[document.combo. example.selecte dIndex].value[color=blue]
    > != "none") {
    > var tre = "<!--" + "# include VIRTUAL=/usr/" +
    > document.combo. example.options[document.combo. example.selecte dIndex].value
    > + ".txt -->" ;
    > alert(tre)
    > venster = window.open("", "","width=400,h eight=600");
    > venster.documen t.write(tre);
    >
    > }
    > </SCRIPT>
    >
    > men! whats wrong.. venster.documen t.write(tre) do not work
    >
    >[/color]

    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

    Comment

    • hijwel

      #3
      Re: document.write( var) include


      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

      Comment

      • Erwin Moller

        #4
        Re: document.write( var) include

        hijwel wrote:
        [color=blue]
        >
        > thx..
        >
        > how can i write in the same document?
        >
        > document.write?[/color]

        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
        scriptinglangua ge, 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
        [color=blue]
        >
        >
        > hijwel
        > ------------------------------------------------------------------------
        > Posted via http://www.forum4designers.com
        > ------------------------------------------------------------------------
        > View this thread: http://www.forum4designers.com/message35833.html[/color]

        Comment

        • Randy Webb

          #5
          Re: document.write( var) include

          hijwel wrote:[color=blue]
          > ------------------------------------------------------------------------
          > Posted via http://www.forum4designers.com
          > ------------------------------------------------------------------------
          > View this thread: http://www.forum4designers.com/message35833.html
          >[/color]


          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.javas cript

          comp.lang.javas cript 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

          Comment

          • Dr John Stockton

            #6
            Re: document.write( var) include

            JRS: In article <hijwel.10fnon@ mail.forum4desi gners.com>, seen in
            news:comp.lang. javascript, hijwel <hijwel.10fnon@ mail.forum4desi gners.co
            m> posted at Thu, 22 Jan 2004 06:10:15 :-[color=blue]
            >[/color]
            thx..[color=blue]
            >
            >how can i write in the same document?[/color]

            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.demo n.co.uk Turnpike v4.00 MIME. ©
            Web <URL:http://www.merlyn.demo n.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.

            Comment

            Working...