Click to See Complete Forum and Search --> : calling a third party script


jub7
02-17-2003, 07:14 AM
I would like to call a third party script on form submition and load my own page after that.

Cannot find an answer so far, is it so hard to do?

jub7
02-17-2003, 11:38 AM
The scipt does change content of the page, actually it returns some data i would like to process.

russell
02-17-2003, 11:59 PM
Actully, you CAN handle the data returned by a foriegn site. But you need to know exactly what to expect and be prepared to handle any errors encountered. Use an IFRAME (can be hidden if you like) to submit the form to the 3rd party site. Use client-side JavaScript to monitor the activity of the IFRAME. When the URL changes in the IFRAME have your JavaScript post a form in the main window to your own server side script to parse the data returned by the 3rd party site. The beauty of the IFRAME is that you can navigte anywhere you want to without changing the content of the visible window. I'll be happy to work up a sample for you when I have a bit more time. Hopefully this helps...

-- rb

missLord
02-18-2003, 12:17 AM
You may also be able to use the WinHTTP .dll for that (comes free with service pack 3) ... It may help.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winhttp/http/winhttp_versions.asp

jub7
02-18-2003, 06:36 AM
I know about using the WinHTTP and this is a solution of course but an overkill, I guess.

I am REALLY surprised I cannot call a script via url
and process the results and return to the same script in ASP
without displaying it to users.
There should be a way I guess but perhaps too deep in ASP documentation.

Actually I am calling an .idc page with parametrs, and the out put is predefined...

Would it be easier calling the script without the need to process the results?

jub7
02-18-2003, 01:08 PM
Actually changing the source of iframe is no problem even across servers, see what works for me below.

Sending the content of the frame to some other page perhaps is harder, I don't know javascr. so well, how to read it submit... and then you still have the problem of returning the results, which can be done again via iframe etc.... and getting complex



function loadnewsrc() {
// Retrieve the IFRAME element from the document tree
var iframe = document.getElementById('COMM');
// By setting the "src" attribute of the hidden frame, we actually ask the
// browser to request a file from server, which in our case is generated by a
// simple CGI script.
iframe.src = "https://www.remoteserver.com/cgi-bin/statusoverview.idc?statusid;
...

}