Page 1 of 1

alert doesnt show

Posted: Fri Mar 16, 2007 11:51 am
by sarris
Hi there...I have this code to implement AJAX communication.It works perfectly.

Code: Select all

function makeRequest(id_wanted){

	var url = "http://www.mysite.gr/areadata.xml";
	var http_request = getHTTPObject();
	http_request.open("GET", url, true);


	http_request.onreadystatechange = function() {
		if(http_request.readyState == 4) {
			if(http_request.status == 200){

				GetArea(http_request,id_wanted);
			}
		}
	}
	http_request.send(null);
My issue is that when i add just above

Code: Select all

GetArea(http_request,id_wanted);
this code

Code: Select all

alert("Something to say here");
the alert doesnt show

Any ideas why that would happen?

Posted: Fri Mar 16, 2007 1:53 pm
by Kieran Huggins
You could use the jQuery ajax functions - specifically there's a method called "$.getScript("test.js");" that will do what you're after.