XML HTTP Requests (CallBacks)
Classic ASP demo files
ASP.NET is directly compatible with this - just paste the lines of code into your .NET project!
Recently there has been a bit of
interest in a "new" technique for doing XML HTTP requests. Now that all browsers
support this, it is a good time to use it. ASP.NET 2.0 will support this
can use it in Classic ASP too.
So what is it?
1. Requires quite a few lines of code
2. User sees a little window popup briefly
3. We can not post the data to the server side, return data can only be dropped back to the opener's vars - if still present - or call an existing function.
Attached is a sample app which I have put together.
xmlRequest.js is the include library which does the work.
xmlRequestTest.asp is a test page to show it working. This just calls the xmlRequest function and has a function waiting for the server side to call back upon.
This solution only uses a few lines of code and is fast to run (much faster again in .NET). There is no negatives to using it, but read my comments in the files carefully. This callback is asynchronous, so once the call has been made, you should not do any more processing until your results are returned. Have the resulting commands kick off the next stage in your processing - see the demo for this.
This command will GET the URI specified and
execute (eval) the resulting text.
The request also has caching prevention included.
Supports all 3 methods of calling the XMLRequest object (Internet Explorer 5.5+, Mozilla 1.7+?, Firefox 1.0+, Konqueror, Safari-X and Opera 7.6+)
Based on techniques by Jim Ley - http://jibbering.com/2002/4/httprequest.html
hunter @ beanland.net.au