Post query string to a server from JS

A

Adrian

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
 
M

Martin Honnen

Adrian wrote:

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.

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.javascript/msg/93b4635194444a18>
for links, the FAQ should be accessible, if faqts is still down then
search msdn.microsoft.com for download behavior.
 
R

Robert

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.

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top