Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

The situation is that i am trying to get d3 to read a JSON file which is stored in Windows Azure Blob storage. If i paste the url into a browser then the file is downloaded to my machine. I would like to be able get the JSON file from the url with d3, but no graph is produced which leads me to believe that the d3 is unable to read the file.

Here is a snippet of the code:

            var url = "http://storageName.blob.core.windows.net/containerName/file.json";

            d3.json("url", function (json) {

             //code here
            })

I have set the container to public on Azure, so i believe that it should be accessible to anyone with the url. Any suggestions?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
699 views
Welcome To Ask or Share your Answers For Others

1 Answer

Should be:

var url = "http://storageName.blob.core.windows.net/containerName/file.json";
d3.json(url, function (json) {
    //code here
});

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...