Post query string to a server from JS

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

    #1

    Post query string to a server from JS

    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


  • Martin Honnen

    #2
    Re: Post query string to a server from JS



    Adrian wrote:

    [color=blue]
    > 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.[/color]

    In some browsers it is possible but usually script in a HTML page loaded
    via HTTP can only connect back to the server the page was loaded from.
    If you want to do that, check the recent posting
    <http://groups-beta.google.com/group/comp.lang.javas cript/msg/93b4635194444a1 8>
    for links, the FAQ should be accessible, if faqts is still down then
    search msdn.microsoft. com for download behavior.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/

    Comment

    • Robert

      #3
      Re: Post query string to a server from JS

      In article <csomch$rt0$1@t itan.btinternet .com>,
      "Adrian" <Adrian@nospamh otmail.com.uk> wrote:

      [color=blue]
      > 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.[/color]

      I read in this forum that you can add search parameters to an image tag.
      I cannot find it now.

      You will have to figure out the exact syntax to preload an image but
      here is the idea...

      var send = new Image()
      send.src = "aURL/somepath/someapplet?prm1 =abc?pram2=1234 ";

      The notify.php program would send back a small image to keep your web
      browser happy.

      Robert

      Comment

      Working...