executing javascript at the server for htm file

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

    #1

    executing javascript at the server for htm file

    i have javascript code that creates some of my html code, e.g.
    </SELECT>
    year* <SELECT size=1 name="dobYYYY">
    <script type="text/javascript" RUNAT="Server">
    d = new Date();
    var year = d.getFullYear() ;
    year = parseFloat(year );
    for (i = year; i > (year - 80) ; i--) {
    document.write( "<OPTION> " + i);
    }
    </script>
    </SELECT><BR><BR>
    so i get an 80 year table without having to code all 80 lines,

    so if i want the 'final' html code to pass the validation test and/or not
    have it viewable in the source,
    how i generate it at the server with vbscript or javascript


  • Lasse Reichstein Nielsen

    #2
    Re: executing javascript at the server for htm file

    "bbxrider" <bbxrider1@comc ast.net> writes:
    [color=blue]
    > i have javascript code that creates some of my html code, e.g.[/color]
    ....[color=blue]
    > <script type="text/javascript" RUNAT="Server">[/color]
    ....[color=blue]
    > for (i = year; i > (year - 80) ; i--) {
    > document.write( "<OPTION> " + i);
    > }
    > </script>[/color]
    [color=blue]
    > so if i want the 'final' html code to pass the validation test and/or not
    > have it viewable in the source,
    > how i generate it at the server with vbscript or javascript[/color]

    That depends on your web server. I assume it runs some kind of ASP.

    Try changing the script tag to
    <script language="JScri pt" runat="server">
    and change the document.write line to
    Response.Write( "<option> "+i+"<\/option>");
    }

    Disclaimer: Just started dabbling in ASP.
    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    Working...