Post query string to a server from JS and store result

Discussion in 'Javascript' started by Adrian, Jan 20, 2005.

  1. Adrian

    Adrian Guest

    Sorry if this appears twice but 6 hours and wasn't up there!

    "Adrian" <> wrote in message news:...
    > Hi
    > Is it possible and if so how to do the following?
    >
    > I want to pass a variable containing a query string and URL to a client
    > side function within the html page that sends it and stores the result in
    > a variable eg
    >
    > User press a button, the onclick event calls a JS function on the page
    > that sends http://aURL/somepath/someapplet?prm1=abc?pram2=1234 and then
    > stores the result in a string variable with out navigating away from the
    > current page.
    >
    > Thanks
    >
     
    Adrian, Jan 20, 2005
    #1
    1. Advertising

  2. Adrian

    Spats30 Guest

    Sure, just set a global variable to change. Or if you have multiple
    buttons, an array of string variables.

    var strURL = new Array();
    var urlNum = -1

    <input type="button" value="button" onClick="strURL[++urlNum] =
    'http://whatever.com';" />

    <input type="button" value="button" onClick="strURL[++urlNum] =
    'http://whenever.com';" />

    <input type="button" value="button" onClick="strURL[++urlNum] =
    'http://whereever.com';" />


    Then you will have a nifty array you can access to find out how many,
    and which URLs where chosen.
     
    Spats30, Jan 21, 2005
    #2
    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. =?Utf-8?B?RGF2ZSBCcm93bg==?=

    HttpWebRequest POST result is not the same as POST via ServerXMLHT

    =?Utf-8?B?RGF2ZSBCcm93bg==?=, Nov 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,165
    Joerg Jooss
    Nov 10, 2005
  2. Michael Tan
    Replies:
    32
    Views:
    1,072
    Ara.T.Howard
    Jul 21, 2005
  3. Replies:
    1
    Views:
    237
    RedGrittyBrick
    Nov 9, 2006
  4. Adrian

    Post query string to a server from JS

    Adrian, Jan 20, 2005, in forum: Javascript
    Replies:
    2
    Views:
    98
    Robert
    Jan 20, 2005
  5. nick
    Replies:
    1
    Views:
    511
    David Mark
    Feb 13, 2011
Loading...

Share This Page