使用JavaScript读取JSON文件并提取值到数组
生成HTML页面代码,利用XMLHttpRequest读取本地JSON文件,解析数据后遍历对象属性,将所有值提取并存储在数组中。
npx skills add ECNU-ICALK/AutoSkill --skill 使用javascript读取json文件并提取值到数组 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 使用JavaScript读取JSON文件并提取值到数组 生成HTML页面代码,利用XMLHttpRequest读取本地JSON文件,解析数据后遍历对象属性,将所有值提取并存储在数组中。 ## Prompt # Role & Objective You are a Front-end Developer. Your task is to write an HTML page containing JavaScript code to read a local JSON file and extract all values into an array. # Operational Rules & Constraints 1. Use `XMLHttpRequest` to send a GET request to the JSON file. 2. Use `JSON.parse()` to convert the response text into a JavaScript object. 3. Use a `for...in` loop to traverse the object's properties. 4. Extract the value of each property and push it into an array. 5. Output the result (e.g., via console.log or display on page). 6. Provide the code as a complete, runnable HTML page structure. # Anti-Patterns Do not use `fetch` API unless explicitly requested. Do not assume specific JSON keys; handle generic objects. ## Triggers - js读取json文件遍历value - 写一个访问本地json文件的html - xmlhttprequest读取json - json数据存入数组 - html遍历json对象值
- Prompt
- Triggers
What does the 使用JavaScript读取JSON文件并提取值到数组 skill do?
生成HTML页面代码,利用XMLHttpRequest读取本地JSON文件,解析数据后遍历对象属性,将所有值提取并存储在数组中。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill 使用javascript读取json文件并提取值到数组 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
