Search code examples
jqueryjsonfilecodepen

Load JSON file from pc folder on codepen project


So I got a JSON file made by my self on a pc folder and I would like to load it into a CodePen project. Since I don't have the typical url taken from the web, how can I load it on that CodePen project? I saw similar questions on StackOverflow but I can't find a good answer for my case. I don't even know if it is possible to do this thing but I try to ask it here. Thank you all!


Solution

  • You cant load it directly into CodePen. But you can copy/paste the content of the file into a variable and point the code to read this variable.