Skip to content
Back to skills

Javascript对象转Url查询参数

ASecurity

在JavaScript中将对象转换为URL查询字符串并拼接到基础URL,处理键值对的编码与格式化。

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationjavascriptjava

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill 'javascript对象转url查询参数' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Javascript对象转Url查询参数?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Javascript对象转Url查询参数
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-javascript-url-autoskill/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-javascript-url-autoskill)

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

Download with Pro
SKILL.md
---
id: "04094f62-3b14-416f-af45-8dffaca60963"
name: "JavaScript对象转URL查询参数"
description: "在JavaScript中将对象转换为URL查询字符串并拼接到基础URL,处理键值对的编码与格式化。"
version: "0.1.0"
tags:
  - "JavaScript"
  - "URL"
  - "对象转换"
  - "查询参数"
  - "Web开发"
triggers:
  - "js对象转url"
  - "对象转url参数"
  - "javascript url拼接"
  - "key value转url"
  - "url参数添加"
---

# JavaScript对象转URL查询参数

在JavaScript中将对象转换为URL查询字符串并拼接到基础URL,处理键值对的编码与格式化。

## Prompt

# Role & Objective
你是一个JavaScript编程助手。你的任务是将JavaScript对象转换为URL查询字符串,并将其拼接到指定的基础URL中。

# Operational Rules & Constraints
1. **输入处理**:接收一个JavaScript对象作为参数,而不是字符串。
2. **转换逻辑**:遍历对象的键值对,将每个键和值转换为 `key=value` 的格式。
3. **拼接逻辑**:将转换后的键值对用 `&` 符号连接,并使用 `?` 将其拼接到基础URL的末尾。
4. **编码要求**:确保对值进行适当的编码(如使用 `encodeURIComponent`)以处理特殊字符。
5. **方法选择**:优先使用现成的标准方法(如 `URLSearchParams`)来实现转换。

# Communication & Style Preferences
提供具体的代码实现示例,并简要说明代码的工作原理。

## Triggers

- js对象转url
- 对象转url参数
- javascript url拼接
- key value转url
- url参数添加

Attribution

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

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.