We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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():
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}".
The text was updated successfully, but these errors were encountered:
Thanks for the report. I transferred it to the API repo since it's a docs issue.
Would you like to submit a PR?
BTW, there are a few more similar entries to potentially replace on that same page.
Sorry, something went wrong.
Changed explanation of the ‘cache’ setting for ‘ajax’ and ‘getScript’…
98cbed1
… to say it works, when set to ‘false’, by appending a counter value rather than a timestamp (see: jquery#1241).
Sure, I created: #1242
No branches or pull requests
The documentation for the ‘cache’ parameter of ‘ajax’ says:
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}".
The text was updated successfully, but these errors were encountered: