1

Can we put an entire path for d3.json ? Because actually for me, the d3.json work only for a path who is on the same place than the file.js, so, can we put a path like this for exemple ?

Exemple :

d3.json("C:\Users\PC Quatorze\Documents\Zahreddine\DPGF\file.json", function(error, json) {
            if (error) throw error;
    }
Zahreddine Laidi
  • 560
  • 1
  • 7
  • 20
  • I have a different problem than the problem you sent me, for me, a simple path like `file.json` works, compared to the link of the problem you sent me or him, it was not working. If I make a path like this: C: \ Users \ PC Fourteen \ Documents \ Zahreddine \ DPGF \ file.json`, the d3.json will not work .. – Zahreddine Laidi Sep 21 '18 at 15:17
  • 2
    If you really want to pursue what you are doing, the correct url format would be `file:///C:/Users/PC Quatorze/Documents/Zahreddine/DPGF/file.json`. **BUT** the point of me closing this as a duplicate is you shouldn't be working like that. It won't work across different browsers and is considered insecure. – Mark Sep 21 '18 at 16:05
  • so what is the best solution to recover a path like this one and that it works on all the navigators ? @Mark – Zahreddine Laidi Sep 22 '18 at 13:32

0 Answers0