HELP with ajax method - callback function not executed
hello all!
i am trying to retrieve json data from the world bank's API, here's my code:
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
var theData;
$(document).ready(function(){
$("button").click(function(){
$.ajax({ url: 'http://api.worldbank.org/sources?format=json',
success: function(data) {
/*this alert message does not show*/
alert(data);
},
dataType: 'json'
});
});
});
</script>
</head>
<body>
<p></p>
<button> Get World Bank Data </button>
</body>
the callback function is not executed but there is response when i checked it using firebug.
i cant figure out what's wrong here. please help.