I have a problem in showing an alert box inside an onsuccess function called by $.ajax. I have checked firebug, and I do receive a response in json format but for some reason the the alert is coming neither am I able to console.log(jsonp). Below is the code:
$.ajax({
type: "GET",
url: "http://maps.googleapis.com/maps/api/directions/json?origin=ajax&destination=toronto®ion=ca&avoid=tolls&sensor=false",
dataType: "jsonp",
success: function(jsonp) {
alert(jsonp);
console.log(jsonp);
}
});
});