hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "collier.matthew" <collier.matt...@gmail.com>
Subject HttpClient AJAX Client
Date Mon, 23 Nov 2009 06:43:31 GMT

I have written a client app based on HttpClient.

I need to simulate the following AJAX/JavaScript function.

Basically, after a simple GET request, I need to wait around until the
server signals that my request has been completed.



	function getCableInfo() {

		var url = "/testboard/DSL/GetCableInformation.pl?random=7.10653400122286"
		var doc;
	
		if (window.ActiveXObject) {
			try {
				doc = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e) {
				document.getElementById('nojs').submit();
			}
		}
    		else if (window.XMLHttpRequest) {
			try {
				doc = new XMLHttpRequest();
			}
			catch(e) {
				document.getElementById('nojs').submit();
			}
		}

		doc.open("GET", url, true);
		doc.setRequestHeader( "Content-Type" , "application/x-www-form-urlencoded;
charset=UTF-8" );
		doc.send("");

		doc.onreadystatechange=function() {
			if (doc.readyState==4) {
				document.getElementById('cableInfo').innerHTML = doc.responseText;
			}
		}
	}
-- 
View this message in context: http://old.nabble.com/HttpClient-AJAX-Client-tp26473409p26473409.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message