alert doesnt show

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
sarris
Forum Contributor
Posts: 137
Joined: Mon Dec 04, 2006 2:44 pm

alert doesnt show

Post 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?
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post 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.
Post Reply