In some project I've met these lines:
$.get("defaults/data.json?", ...);
$.get("defaults/structure.html?", ...);
$.get("defaults/style.css?", ...);
On server side these files without any extra symbols, so I'm wondering what does the question mark at the end of files mean?
The ?
in a URL denotes the start of the query string. A ?
at the end with no variables following it is usually an unnecessary way of saying "this has absolutely no querystring".
It would be possible with a URL rewriting engine for example, to examine the incoming REQUEST_URI to see if it ends with ?
and take a different action than requests not ending in ?
, but that would be an unusual usage. It would much more common to just specify some value in the query string.
"?" is the separator for supplying arguments via a GET request.
? states you're providing arguments via HTTP GET.
For example if you want to send a=1 and b=2 , you would do http://mysite.com/myfile.php?a=1&b=2
Shai.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With