diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 9074388b..957ddd56 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -47,7 +47,7 @@ $.ajax({ <desc>A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an <a href="/Ajax_Events/">Ajax Event</a>. Returning <code>false</code> in the <code>beforeSend</code> function will cancel the request. <strong>As of jQuery 1.5</strong>, the <code>beforeSend</code> option will be called regardless of the type of request.</desc> </property> <property name="cache" default="true, false for dataType 'script' and 'jsonp'" type="Boolean"> - <desc>If set to <code>false</code>, it will force requested pages not to be cached by the browser. <strong>Note:</strong> Setting <code>cache</code> to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET.</desc> + <desc>If set to <code>false</code>, it will force requested pages not to be cached by the browser. <strong>Note:</strong> Setting <code>cache</code> to false will only work correctly with HEAD and GET requests. It works by appending <code>_=<i>{counter}<i></code> to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET.</desc> </property> <property name="complete" type="Function"> <argument name="jqXHR" type="jqXHR"/> @@ -102,9 +102,9 @@ $.ajax({ <ul> <li><code>"xml"</code>: Returns a XML document that can be processed via jQuery.</li> <li><code>"html"</code>: Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.</li> - <li><code>"script"</code>: Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, <code>_=[TIMESTAMP]</code>, to the URL unless the <code>cache</code> option is set to <code>true</code>. <strong>Note:</strong> This will turn POSTs into GETs for remote-domain requests. Prior to jQuery 3.5.0, unsuccessful HTTP responses with a script <code>Content-Type</code> were still executed.</li> + <li><code>"script"</code>: Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, <code>_=<i>{counter}</i></code>, to the URL unless the <code>cache</code> option is set to <code>true</code>. <strong>Note:</strong> This will turn POSTs into GETs for remote-domain requests. Prior to jQuery 3.5.0, unsuccessful HTTP responses with a script <code>Content-Type</code> were still executed.</li> <li><code>"json"</code>: Evaluates the response as JSON and returns a JavaScript object. Cross-domain <code>"json"</code> requests that have a callback placeholder, e.g. <code>?callback=?</code>, are performed using <a href="https://bob.ippoli.to/archives/2005/12/05/remote-json-jsonp/">JSONP</a> unless the request includes <code>jsonp: false</code> in its request options. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of <code>null</code> or <code>{}</code> instead. (See <a href="https://json.org/">json.org</a> for more information on proper JSON formatting.)</li> - <li><code>"jsonp"</code>: Loads in a JSON block using <a href="https://bob.ippoli.to/archives/2005/12/05/remote-json-jsonp/">JSONP</a>. Adds an extra <code>"?callback=?"</code> to the end of your URL to specify the callback. Disables caching by appending a query string parameter, <code>"_=[TIMESTAMP]"</code>, to the URL unless the <code>cache</code> option is set to <code>true</code>.</li> + <li><code>"jsonp"</code>: Loads in a JSON block using <a href="https://bob.ippoli.to/archives/2005/12/05/remote-json-jsonp/">JSONP</a>. Adds an extra <code>"?callback=?"</code> to the end of your URL to specify the callback. Disables caching by appending a query string parameter, <code>_=<i>{counter}<i></code>, to the URL unless the <code>cache</code> option is set to <code>true</code>.</li> <li><code>"text"</code>: A plain text string.</li> <li>multiple, space-separated values: <strong>As of jQuery 1.5</strong>, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use <code>"text xml"</code> for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: <code>"jsonp text xml"</code>. Similarly, a shorthand string such as <code>"jsonp xml"</code> will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml.</li> </ul> diff --git a/entries/jQuery.getScript.xml b/entries/jQuery.getScript.xml index d44d1f3a..1e36dfe1 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -58,7 +58,7 @@ $( "div.log" ).on( "ajaxError", function( e, jqxhr, settings, exception ) { </code></pre> <p>Prior to jQuery 3.5.0, unsuccessful HTTP responses with a script <code>Content-Type</code> were still executed.</p> <h4 id="caching-requests">Caching Responses</h4> - <p>By default, <code>$.getScript()</code> sets the cache setting to <code>false</code>. This appends a timestamped query parameter to the request URL to ensure that the browser downloads the script each time it is requested. You can override this feature by setting the cache property globally using <a href="/jquery.ajaxsetup/"><code>$.ajaxSetup()</code></a>: </p> + <p>By default, <code>$.getScript()</code> sets the cache setting to <code>false</code>. This appends a query parameter with a counter value to the request URL to ensure that the browser downloads the script each time it is requested. You can override this feature by setting the cache property globally using <a href="/jquery.ajaxsetup/"><code>$.ajaxSetup()</code></a>: </p> <pre><code> $.ajaxSetup({ cache: true