noscript-tag
它能做什么
这个技能检查当 JavaScript 被关闭或加载失败时,页面是否仍然显示关键内容,并提供有用的替代方案。它面向希望网站对所有人都可用的网站构建者。
适用场景
- ✓你请智能体检查关闭了 JavaScript 的用户会看到什么的时候。
- ✓页面在没有 JavaScript 时是空白的,而你希望核心内容出现在初始 HTML 中的时候。
- ✓你添加了依赖 JavaScript 的功能,需要带有有用替代方案的 noscript 提示的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/noscript-tag/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“如果有人关闭了 JavaScript,我的页面就是空白的。请帮我添加备用内容,让主要信息仍然能显示吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查服务器发送的首个 HTML 中是否包含重要内容,而不只是脚本运行之后才出现。然后它会为需要 JavaScript 的功能添加 noscript 代码块,提供真实的替代内容或链接。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Provide noscript fallback content
Users with JavaScript disabled, blocked by corporate firewalls, or with failed script loads see blank pages without proper noscript fallbacks.
Quick Reference
- Add <noscript> with helpful message for JS-dependent features
- Provide alternative content, not just 'Enable JavaScript'
- Use for critical features: analytics fallback, lazy-loaded images
- Consider progressive enhancement: content works without JS
- Important content should be present in the initial HTML, not fetched only after hydration
Check
Verify that this page provides appropriate noscript fallbacks for users with JavaScript disabled or unavailable, ensuring core functionality remains accessible. Confirm important content exists in the initial HTML and is not blocked on hydration.
Fix
Add noscript elements with alternative content or functionality for critical features that depend on JavaScript. Replace UA-sniffed behavior with feature detection and make sure the server-rendered HTML already contains the important content and pagination paths.
Explain
Explain why noscript fallbacks are important for accessibility, progressive enhancement, and ensuring your site works for all users regardless of their JavaScript support. Explain why feature detection is safer than UA sniffing and why hydration mismatches can break progressive enhancement.
Code Review
Review templates, server-rendered HTML, and shared components that output markup related to Provide noscript fallback content. Flag exact elements, attributes, and routes where the rendered HTML violates the rule.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/html/noscript-tag
常见问题
noscript 提示只写“请启用 JavaScript”够吗?
不够。这个技能说,应该提供替代的内容或功能,而不仅仅是请用户开启 JavaScript。
为什么服务器端渲染的 HTML 很重要?
这意味着即使脚本还未加载,主要内容也是可见的,这对脚本被阻止的用户和搜索引擎都有帮助。
我应该使用功能检测吗?
应该。这个技能推荐功能检测,而不是浏览器识别,因为它更可靠。
详情
作者的原始描述
Use when reviewing templates, rendered HTML, or shared components related to Provide noscript fallback content. Validate the final browser-facing markup, not just the source framework abstraction.
热度
- GitHub 星标
- 75k
- 排名
- #2954
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。