`document` is not defined Electron
问题 I'm trying to read JSON from a file using the fs module, and display that in a div with id list in an Electron app. My code in index.js looks like this: dialog.showOpenDialog((filenames) => { if (!filenames) return; fs.readFile(filenames[0], (err, data) => { if (err) { alert('Could not read file.\n\nDetails:\n' + err.message); return; } let json = JSON.parse(data).en; for (let i = 0; i < json.length; ++i) { let html = "<div class='entry'><b>"; // Add more to html variable from json data $(