I'm trying to read a json url but JSON appearing some extra string before JSON start
JSON script is like:
throw 'allowIllegalResourceCall is false.';
{
"name":"mkyong",
"age":30,
"address":{
"streetAddress":"88 8nd Street",
"city":"New York"
},
"phoneNumber":[
{
"type":"home",
"number":"111 111-1111"
},
{
"type":"fax",
"number":"222 222-2222"
}
]
}
I'm trying to read this JSON using this below javascript:
<script>
$(document).ready(function() {
$('.button').click(function(){
var ur= "http://json_url";
alert(ur);
alert(JSON.stringify($.getJSON(ur)));
});
});
</script>
Is there any way to read this types of Json using java script/jQuery or ajax.