We create platforms to promote software literacy within the visual arts, and visual literacy within technology-related fields.
本篇文章围绕 Coding Train 网站存档(website-archive)中《数据与 API》系列教程的第 4 讲——"Loading JSON data from a URL (Asynchronous Callbacks!)"展开,逐行拆解该讲配套源码,说明如何把本地 JSON 文件替换 ...
从源码结构看,数据流是一条清晰的单向链:用户在网页上选中单词 → 内容脚本 content.js 通过 chrome.runtime.sendMessage 把单词发到后台 → 后台 background.js 把单词写入全局变量 word → 用户点击扩展图标打开弹窗 sketch/index.html → 弹窗内的 p5 脚本 sketch.js 通过 ...