Help! #exec and javascript parameters

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

    #1

    Help! #exec and javascript parameters

    Hi,

    I have an shtm file which collects a parameter in javascript like so:

    var myValue = location.search .substring( 1 );
    myValue = myValue.split( '=' );
    myValue = myValue[1];

    Works great. Now, in the page itself, I need to #exec a CGI (and insert the
    response) using the myValue param as a param to the CGI: I have tried this:

    <!-- #exec CGI="/scripts/test/MyCGI.exe?user_ text=" + <script language =
    "JavaScript " type = "text/JavaScript">myV alue</script> -->

    But the CGI is not getting the myValue string at all.

    If I hard code the value it works as expected - but obviously this is no
    good. How do I pass this value to the CGI?

    TIA
    M.



  • Andrew Urquhart

    #2
    Re: Help! #exec and javascript parameters

    Adam Guy wrote:
    <cut />[color=blue]
    > I have tried this:
    >
    > <!-- #exec CGI="/scripts/test/MyCGI.exe?user_ text=" + <script
    > language = "JavaScript " type = "text/JavaScript">myV alue</script> -->
    >
    > But the CGI is not getting the myValue string at all.[/color]

    You've got a bit confused between processing that happens on the web
    server and processing that happens on the client. The script tag [1] is
    designed to be processed on the client (e.g. a web browser) - the
    webserver simply doesn't understand it. Look for an all server-side
    solution instead. The comp.infosystem s.www.authoring.cgi newsgroup seems
    to be the best place to ask.

    [1] Some server-side scripting engines do act on script tags, but not in
    the format shown above
    --
    Andrew Urquhart
    - Contact: www.andrewu.co.uk/contact/
    - Employ me: Front/middle tier ASP developer with WAI & web standards


    Comment

    Working...