When inspecting the live mail URL i have seen that they use #
instead if Query string
.
https://bluxxx.mail.live.com/#n=xxxxxxxxx&fid=x
When the #
is removed it's a 404 error. Is there any advantage of using # instead of query string. Can it be implemented in a php application.
The hashed url is often used in place of actually going back to the server for another page (that is, the page load is intercepted by Javascript).
The hash and anything after it is not usually sent to the server...
Imagine the following scenario...
<a id="SomeLink" href="#DoSomething">
You then attach an onclick using Javascript...
$("#SomeLink").click(function() {...})
If that click function doesn't return false
, the url will now have a #DoSomething
on the end of it, even though a request to the server hasn't been made.
It can also be useful as a placeholder for manipulating the history so you can have greater control over the Back/Forward buttons (or many otherclient-side javscript tricks). See history.js as an example.
The hash part of the URL is essentially for client side handling. Your javascript can read it, and if you have a named anchor on your page, it will scroll to that content. The hash part of the URL is not sent to the server by the browser on loading the URL with the hash, where as the query string is sent to the browser, and hence accessible by PHP.