I am trying to get the JSON data from a URL that outputs the following JSON data:
[
{
"belief_desc":"Jesus Died For Your Sins",
"0":"Jesus Died For Your Sins"
},
{
"belief_desc":"People Are Sinful",
"0":"People Are Sinful"
},
{
"belief_desc":"God Loves You",
"0":"God Loves You"
},
{
"belief_desc":"We Must Receive Christ",
"0":"We Must Receive Christ"
}
]
(Note: it is only formatted in this question for easier reading.)
Now I am trying to parse through it using this simple jQuery script:
<script>
var url = "http://mySite.com/data.json";
$.getJSON(url, function(data){
alert(data);
});
</script>
I am getting no data from the URL as the alert will not show. Any ideas on why this is not working?
Cross domain you can't do simple JSON.
Basic how-to for cross domain jsonp
Read up on cross domain requests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With