Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a URL with a hash but with no question mark valid?

Tags:

url

In order to keep track of AJAX changes on a webpage, I will be constantly adding to or changing the hash fragment. Is it valid to append a hash to a URL without adding a question mark first?

Example:

http://www.mysite.com#thisisthehash

like image 433
dmr Avatar asked Oct 14 '25 07:10

dmr


1 Answers

Yes - it is perfectly valid for URLs to have a fragment identifier (denoted by a hash) without a querystring (denoted by a question mark).

As RFC-3986 shows, both the query and fragment parts are optional and unrelated in terms of their optionality.

like image 197
Andy Avatar answered Oct 16 '25 23:10

Andy