By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,947 Members | 1,548 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,947 IT Pros & Developers. It's quick & easy.

Post query string to a server from JS

P: n/a
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
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a


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.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

P: n/a
In article <cs**********@titan.btinternet.com>,
"Adrian" <Ad****@nospamhotmail.com.uk> 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.


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
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.