In the JQuery documentation .get() uses only url , data (content), dataType and success dataType as its parameters. What you really want to do is modify the jqXHR object before sending it. Using .ajax() this is done using the beforeSend() method. But since .get() is a shortcut, it does not allow it.
It is relatively easy to switch .ajax() calls to .get() calls. In the end, .get() is just a subset of .ajax() , so you can use all the defaults for .ajax() (except, of course, beforeSend() ).
Edit:
:: Take a look at Jivings answer ::
Oh yes, I forgot about the cache parameter! While beforeSend() is useful for adding other headers, the built-in cache parameter is much simpler here.
Thomas Kelley Jan 12 2018-12-12T00: 00Z
source share