Mention of ‘timestamp’ in documentation for ‘cache’ parameter of ‘ajax’ is misleading

オープン 初心者向け
#1,241 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

@Rinzwind がすでに取り組んでいます。

2023年11月15日 から。

  • #1242 @Rinzwind による — オープン

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
62/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
jquery
領域
documentation

調査の方向性

ajax の cache パラメーターのドキュメントエントリから始め、参照されている dist/jquery.js の 9435 行目と 8501 行目とその記述を比較します。追加される値を timestamp ではなく uid として参照するように説明を更新します。誤解を招く記述は表示されないようにしてください。

索引モデルが issue の本文から書いたものです。

説明

The documentation for the ‘cache’ parameter of ‘ajax’ says:

It works by appending "_={timestamp}" to the GET parameters.

This seems a bit misleading. I interpreted it as a timestamp of when the request is sent. But the value after _= is actually taken from a counter:

https://github.com/jquery/jquery/blob/f79d5f1a337528940ab7029d4f8bbba72326f269/dist/jquery.js#L9435

The counter is only initialized using Date.now():

https://github.com/jquery/jquery/blob/f79d5f1a337528940ab7029d4f8bbba72326f269/dist/jquery.js#L8501

I got confused by that when analyzing nginx access logs and wondering why the ‘timestamps’ didn’t match up.

The documentation should probably just say that it works by appending "_={uid}".

主要言語
HTML
スター
324
フォーク
259
平均マージ
1日 30分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

jquery/api.jquery.com のほかの issue

jquery/api.jquery.com の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。