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

Howto get data from Server

P: n/a
PVU
Hello,

I have an page that calls the function below.
What i want to do is that this function post data to the server (ASP) and
the server will response with 'OK'
My question is how can i send data clientside from Javascript to the server
? (navigate ? with url ?)
and check the returned data in the same function ?
function ShowData(TxtArt)
{
alert(TxtArt + ' : ' + parent.frames.Bottom.TxtUsrName.value + ' - ' +
parent.frames.Bottom.TxtRemarque.value); // testing purpose
// post the data to the server. ex .. myURL.asp?userID=1000&Art=ART1201
// fetch the data from the server. to verify if the 'OK' is recieved ->
the server will response with 'OK'
// if 'ok' -> i will update clientside an frame (ex. contents of
shoppingbasket)
}

Any idea's ?
Kind Regards,
Peter Verburgh
Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hello, PVU!
You wrote on Thu, 1 Apr 2004 23:20:15 +0200:

P> I have an page that calls the function below.
P> What i want to do is that this function post data to the server (ASP)
P> and the server will response with 'OK'
P> My question is how can i send data clientside from Javascript to the
P> server ? (navigate ? with url ?)
P> and check the returned data in the same function ?
P> function ShowData(TxtArt)
P> {
P> alert(TxtArt + ' : ' + parent.frames.Bottom.TxtUsrName.value + ' -
P> ' +
P> parent.frames.Bottom.TxtRemarque.value); // testing purpose //
P> post the data to the server. ex .. myURL.asp?userID=1000&Art=ART1201
P> // fetch the data from the server. to verify if the 'OK' is recieved
P> ->
P> the server will response with 'OK'
P> // if 'ok' -> i will update clientside an frame (ex. contents of
P> shoppingbasket)
P> }

IMHO, there is no common way to implement such kind of operations (in
javascript, there may be something in VBScript, like Request/Response
objects, but i'm not sure).

I think the most reasonable way is to post data to server-side script, wich
can perform some action (validate etc) and depending on results respond to
frame proper html-page.
Something like:
- your page consist of two frames - first is a form, ssecond - is a basket;
- form submit with action="show.asp" target="secondframe";
- show.asp checks if TxtUsrName is real user name;
- if yes - response is a basket;
- if no - response is an error page, catalog, banner etc ;)

Good luck

// WBR, Mozyra Stepan
// SM17-UANIC
Jul 23 '05 #2

P: n/a
Ivo
PVU said:
What i want to do is that this function post data to the server (ASP) and
the server will response with 'OK'
My question is how can i send data clientside from Javascript to the server ? (navigate ? with url ?)
and check the returned data in the same function ?
function ShowData(TxtArt)
{
alert(TxtArt + ' : ' + parent.frames.Bottom.TxtUsrName.value + ' - ' +
parent.frames.Bottom.TxtRemarque.value); // testing purpose
// post the data to the server. ex .. myURL.asp?userID=1000&Art=ART1201
// fetch the data from the server. to verify if the 'OK' is recieved ->
the server will response with 'OK'
// if 'ok' -> i will update clientside an frame (ex. contents of
shoppingbasket)
}

Any idea's ?


For selected browsers only, the xml http request object, as mentioned in the
FAQ:
http://jibbering.com/faq/#FAQ4_38
http://www.galasoft-LB.ch/myjava/Web...Demo/Demo.html
http://jibbering.com/2002/4/httprequest.html
in tango with some clever serverside processing.
HTH
Ivo
Jul 23 '05 #3

P: n/a
PVU
tnx
i'll check it out.
Peter.

"PVU" <pe*****@skynet.be> schreef in bericht
news:40**********************@news.skynet.be...
Hello,

I have an page that calls the function below.
What i want to do is that this function post data to the server (ASP) and
the server will response with 'OK'
My question is how can i send data clientside from Javascript to the server ? (navigate ? with url ?)
and check the returned data in the same function ?
function ShowData(TxtArt)
{
alert(TxtArt + ' : ' + parent.frames.Bottom.TxtUsrName.value + ' - ' +
parent.frames.Bottom.TxtRemarque.value); // testing purpose
// post the data to the server. ex .. myURL.asp?userID=1000&Art=ART1201
// fetch the data from the server. to verify if the 'OK' is recieved ->
the server will response with 'OK'
// if 'ok' -> i will update clientside an frame (ex. contents of
shoppingbasket)
}

Any idea's ?
Kind Regards,
Peter Verburgh

Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.