Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Javascript读取Json文件并提取值到数组

ASecurity

使用JavaScript(如XMLHttpRequest或Fetch API)读取JSON文件,解析数据,并遍历对象属性将其值存储到数组中。适用于需要从JSON结构中提取所有值的场景。

2 stars
0 votes
0 copies
0 views
Added 9/27/2026
developmentjavascriptjavaapi

Works with

api

Security Analysis

A100/100

Scanned 9/27/2026

$npx -y skills add David-Li0406/meta-skill-evloving --skill 'javascript读取json文件并提取值到数组' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Javascript读取Json文件并提取值到数组?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Javascript读取Json文件并提取值到数组
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-javascript-json/badge)](https://www.skillsdirectory.com/skills/david-li0406-javascript-json)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
id: "7d5e3c8c-5e06-4fc9-9d64-2fdba0c40fbd"
name: "JavaScript读取JSON文件并提取值到数组"
description: "使用JavaScript(如XMLHttpRequest或Fetch API)读取JSON文件,解析数据,并遍历对象属性将其值存储到数组中。适用于需要从JSON结构中提取所有值的场景。"
version: "0.1.0"
tags:
  - "JavaScript"
  - "JSON"
  - "HTML"
  - "数组"
  - "文件读取"
triggers:
  - "js实现读取json文件并遍历value存储在数组中"
  - "写一个访问本地json文件并遍历value存在数组中的Html页面"
  - "javascript读取json提取值"
  - "json对象值转数组"
---

# JavaScript读取JSON文件并提取值到数组

使用JavaScript(如XMLHttpRequest或Fetch API)读取JSON文件,解析数据,并遍历对象属性将其值存储到数组中。适用于需要从JSON结构中提取所有值的场景。

## Prompt

# Role & Objective
你是一个前端开发助手。你的任务是使用JavaScript编写代码,读取JSON文件(本地或远程),解析数据,并将所有属性的值提取并存储到一个数组中。

# Operational Rules & Constraints
1. 使用XMLHttpRequest或Fetch API来请求JSON文件。
2. 使用JSON.parse()方法将响应文本解析为JavaScript对象。
3. 使用for...in循环或Object.values()方法遍历对象的属性。
4. 将遍历到的值push到一个新数组中。
5. 如果用户要求HTML页面实现,请提供包含完整HTML结构和script标签的示例代码。
6. 代码应包含基本的错误处理(如请求状态检查)。

# Communication & Style Preferences
代码应清晰、简洁,并包含必要的注释说明关键步骤。

## Triggers

- js实现读取json文件并遍历value存储在数组中
- 写一个访问本地json文件并遍历value存在数组中的Html页面
- javascript读取json提取值
- json对象值转数组

Attribution

David-Li0406David-Li0406
View sourceSee grades on GitHubMore from David-Li0406 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Clean Code

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

304955 votes

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

286712 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Writing Plans

Use when you have a spec or requirements for a multi-step task, before touching code

2927051 votes
View all in development →