Actually i should display the JSON data in a browser, so far i am getting the data in browser response body but here is the problem. i am facing that not able to display it in browser here picture for better understanding, any one please help me. Thanks in advance.
HTML code is:
<!DOCTYPE html>
<html lang="en">
<head><title>Demo</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /></head>
<body>
<input id="testbutton" type="button" value="Test" />
<p id="results">results appended here: </p>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#testbutton").click(function() {
$.ajax({
url: 'http://localhost:8080/SMWS/Rest/parentService/parent/getSchoolDetails',
dataType: 'jsonp',
success: function(data) {
$("#results").append('all good');
alert(JSON.stringify(data));
},
error: function() {
$("#results").append("error");
alert('error');
}
});
});
});
</script>
</body>
</html>