{ "name": "value" }
and it's called as
<script type="text/javascript" src="http://example.com/json"></script>
Whereas JSONP looks like this:
functionName({ "name": "value" });
and it's called as
<script type="text/javascript" src="http://example.com/json?callback=functionName"></script>
<script type = "text/javascript"> window.melodyCallback = function(data) { console.log(JSON.stringify(data)); }; </script> <script type="text/javascript" src="http://localhost:8080/mywebapp/monitoring?format=jsonp"></script>Note the jsonp format and the "melodyCallback" function.
--
---
You received this message because you are subscribed to the Google Groups "javamelody" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javamelody+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
$.ajax({
url : srvUrl,
dataType : 'jsonp',
jsonp : 'melodyCallback',
success : function(data){
console.log(JSON.stringify(data));
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.status + " / " + thrownError);
}
});