Please find the below code. while debugging the code using Chrome java script debugger, URL is hit and Debugger is displaying the correct json data from the URL [Under the source column] but there is no response in the browser after button click. I want to display the json data after button click. Can you please help in this ?
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
function test() {
var key="encryptedAPIkeyvalue";
$.ajax({
url: "http://localhost:82/JSON/Lookups/ComponentTypes?apiKey=" + key + "&callback=" ,
dataType: "jsonp",
success: function(data){
$.each( data , function( i, item ) {
alert(item);
$("#output").append(item);
});
}
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="output"></div>
<button id="tbn" onclick="Javascript:test();return false;">click</button>
</form>
</body>
</html>