How to document web errors - The MDN project 编辑

The MDN JavaScript error reference is a new project aiming to help web developers with errors occurring in the Developer Console.

You can see this feature in action in Firefox (Developer Edition). JavaScript errors contain a "Learn more" link that takes you to the JavaScript error reference containing additional advice for fixing issues.

In order to help this project, we need to write more error documentation on MDN so that we can add more links to the tools where the messages are thrown.

Prerequisites

Step 1 – find an error to document

Step 2 – look at existing error docs

  • Look at the existing JavaScript error reference and see how errors are documented.
  • Depending on which type of error you want to write about, you can take a closer look at these pages.
  • You might want to copy the content of an existing page to kick off your new page.

Step 3 – create a new page

Step 4 – write some content

  • Either use a copied structure from one of the existing error documents or start from scratch. Your choice!
  • You should have at least:
    • A syntax box containing the message as thrown in different browsers.
    • The error type.
    • A text that explains why this error happened, what its consequences are. Go beyond the thrown message.
    • Examples showcasing the error (there might be more than one!) and an example showing how to fix the code.
    • Pointers to other reference material on MDN.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:127 次

字数:3613

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文