ajax 调用的 Javascript 注释

发布于 2024-09-26 22:01:38 字数 176 浏览 1 评论 0原文

目前我在记录 javascript 函数时使用 phpDoc 风格的注释,主要是因为我已经习惯了语法,并且我觉得 phpDoc 是一种很好的、​​全面的注释风格。

但它没有涵盖的一件事是 Ajax 请求(显然),我想知道是否有一套标准来评论这些请求?或者,如果有人对评论调用正在做什么、应该返回什么等的最佳方式有任何建议。

At the moment I use phpDoc style comments when documenting javascript functions, mainly because I am used to the syntax and I feel that phpDoc is a good, comprehensive commenting style to adopt.

One thing it doesn't cover though is Ajax requests (obviously) and I was wondering if there was a set standard for commenting these? Or if anyone had any suggestions on the best way to comment what the call is doing, what it should return, etc.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吲‖鸣 2024-10-03 22:01:38

为了保持 phpdoc 风格,我将 AJAX 调用视为一个函数,并主要使用自由文本描述来描述预期内容的细节。这就是您对函数所做的事情,而且目前还没有 AJAX 调用的标准,所以就这样做吧。也许你可以开始一个!关于它或其他东西的博客。

In order to stay with the phpdoc style, I would treat the AJAX call like it's a function, and mainly use the free text description to describe the detail of what's expected. That's what you do with functions, and there's no existing standard for AJAX calls AFAIK, so just do that. Maybe you could start one! Blog about it or something.

且行且努力 2024-10-03 22:01:38

Read this great article about javascript code documentation and generating documentation files @ dailyjs.com - it should set you up with what you need.

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