Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2006, 08:50 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default URGENT - retrieve javascript variable into asp

Hi,

I've been struggling with this for days. I am calling a function from a very complex asp page/form that uses the XMLHTTP object to handle some processing on another server. I need to grab the result of the call which is in javascript. I know that everything I read says to load the javascript into a hidden field on a form and submit it. This is not an option for me, because the calling page is so complicated. It would take forever to reload the entire form and fill in all previously entered data, just to get to the point where I left off. I then tried using a session variable, but since my results are being set from another server using the XMLHTTP object, the session data is not retained.

Please help! I'm approaching my deadline and not getting anywhere!
Thanks.
MelissaM
 
Old June 14th, 2006, 10:15 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Melissa,

Can you create a page on your server then use XmlHttp to send the data to that page & process it there?

Cheers,

Chris

 
Old June 14th, 2006, 12:58 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I thought of that, but I'm getting so confused since I already have a call to xmlhttp for a different reason.
I'm pretty new to this object.

I have a js function that uses xmlhttp to call a server side script which access another domain via asp. I return the results back to the js function. This is where I'm stuck since the results are in js.

So I need to create an ASP function that calls my js function from the server using xmlhttp? (I'm so confused!)
Can you elaborate on what part you think needs to be in asp and what in js? Ultimately I need my return status value back in an ASP variable.

Thanks.
Melissa
 
Old June 15th, 2006, 03:23 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Melissa,

Sounds like you may be able to create an ASP page that you call via XmlHttp from your JavaScript with the results from the first call.

On this ASP page, you can do whatever processing you need to do using the information in the XmlHttp call.

So...

1. Client-side: send XmlHttp request to other server
2. Client-side: parse XmlHttp response from other server and create XmlHttp request to your server with results
3. Server-side: parse XmlHttp request and action as required

You cannot call a clientside function from the server using XmlHttp.

HTH,

Chris





Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing ASP variable from Javascript sasidhar79 Classic ASP Basics 2 March 8th, 2017 05:31 PM
storing Javascript variable to ASP variable rupen Classic ASP Basics 5 April 10th, 2007 07:06 AM
assign javascript variable to asp variable manjunath_c_k Classic ASP Basics 1 September 14th, 2006 07:35 AM
Javascript variable values into ASP phungleon Classic ASP Basics 2 May 13th, 2004 02:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.