Request.QueryString w/o ASP?

Discussion in 'ASP General' started by jp2express, Jan 5, 2008.

  1. jp2express

    jp2express Guest

    Does Request.QueryString need to be carried out using ASP, or can JavaScript
    handle this?

    I know it is simple, but I've never done it and I don't know what to search
    for.

    Say I wanted my default web page to display my projects. I want to be able
    to pass a link like this:

    www.joeswelding.biz/index.htm?page=projects

    Do I need to change my index page to ASP to do this? I know it isn't hard to
    change, but I hate not knowing another way (like JavaScript) to do things
    (like QueryString).

    Regards!
    Joe
    jp2express, Jan 5, 2008
    #1
    1. Advertising

  2. jp2express

    Evertjan. Guest

    jp2express wrote on 05 jan 2008 in
    microsoft.public.inetserver.asp.general:

    > Does Request.QueryString need to be carried out using ASP, or can
    > JavaScript handle this?


    Your Q is impossible to anwer directly,
    since you presume things that are not true:

    On topic:

    Yes, Request.QueryString needs to be carried out using ASP.

    But:

    ASP is not a language, but a serverside platform,
    having the Request object.

    Yes, Javascript can be used serverside on the ASP platform,
    and so can use the Request object.

    Off topic:

    No, clientside Javascript does not have access to a Request object.

    Yes, clientside Javascript can get the querystring,
    not using a request object,
    but using window.location.search.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Jan 5, 2008
    #2
    1. Advertising

  3. jp2express

    jp2express Guest

    Thanks! That's what I was looking for. I guess JavaScript doesn't have a
    neat client side version.

    Evertjan, if you are reading this, sorry to have upset you, but how do you
    ask a question if you don't know the proper way to phrase it? I didn't know
    if a JavaScript technique was client side or server side, but the fact that
    I did not want to turn my HTML page into an ASP page should have answered
    your question.

    Thanks for the help!

    "McKirahan" <> wrote in message
    news:...
    > "jp2express" <> wrote in message
    > news:hQTfj.28308$...
    >> Does Request.QueryString need to be carried out using ASP, or can

    > JavaScript
    >> handle this?

    >
    > Yes.
    >
    >> I know it is simple, but I've never done it and I don't know what to

    > search
    >> for.
    >>
    >> Say I wanted my default web page to display my projects. I want to be
    >> able
    >> to pass a link like this:
    >>
    >> www.joeswelding.biz/index.htm?page=projects
    >>
    >> Do I need to change my index page to ASP to do this? I know it isn't hard

    > to
    >> change, but I hate not knowing another way (like JavaScript) to do things
    >> (like QueryString).

    >
    >
    > Will this help?
    >
    > <html>
    > <head>
    > <title>index.htm</title>
    > <script type="text/javascript">
    > window.onload = function() {
    > var qstr = unescape(location.search);
    > if (qstr.length == 0) return;
    > qstr = qstr.substr(1);
    > var pair = qstr.split("=");
    > if (pair[0] == "page") {
    > if (pair[1] == "projects") alert("PROJECTS!");
    > if (pair[1] == "something") alert("SOMETHING!");
    > }
    > }
    > </script>
    > </head>
    > <body>
    > </body>
    > </html>
    >
    >
    jp2express, Jan 7, 2008
    #3
  4. jp2express wrote:
    > Thanks! That's what I was looking for. I guess JavaScript doesn't
    > have a neat client side version.
    >
    > Evertjan, if you are reading this, sorry to have upset you,


    Given that he answered your question, I'm not sure how you can say he was
    upset. Beware of trying to read emotion into text messages, especially those
    from people whose first language is not English.

    > but how
    > do you ask a question if you don't know the proper way to phrase it?


    The phrasing was not the issue.

    > I didn't know if a JavaScript technique was client side or server
    > side,


    It can be either. Javascript is a scripting language that can be used in
    either server-side or client-side code.

    > but the fact that I did not want to turn my HTML page into an
    > ASP page should have answered your question.
    >

    As well as your own. If it's not a .asp page, then it's not an "asp"
    question, now is it? It pretty much HAS to involve client-side code, which
    is better handled in a client-side scripting group like
    microsoft.public.scripting.jscript or comp.lang.javascript.

    Again, do not read this as a rebuke: it is intended to help you get help
    more efficiently in the future.

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Jan 7, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Bass
    Replies:
    2
    Views:
    3,695
    dave wanta
    Jul 4, 2003
  2. George
    Replies:
    5
    Views:
    6,590
    George
    Apr 2, 2004
  3. michaaal
    Replies:
    6
    Views:
    397
    Michael D. Kersey
    Jul 15, 2003
  4. John Davis
    Replies:
    2
    Views:
    372
    Dave Anderson
    Aug 18, 2003
  5. Ivan
    Replies:
    5
    Views:
    150
Loading...

Share This Page