I manually uploaded the data to my file with .json extension, I wrote it. This file works on url and on notepad ++.
I wanted to call this via jquery from my website where I uploaded it.
This gives the error
What to do?
My code is;
$(document).ready(function() {
$.getJSON("https://example.com/data.json", function (data) {
var count = Object.keys(data).length;
console.log(count);
})
});

Aucun commentaire:
Enregistrer un commentaire