If you want to access referer and user-agent, those are available to client-side Javascript, but not by accessing the headers directly.
To retrieve the referer, it is document.referer
, to access the user-agent, use navigator.userAgent
.
EDIT: My apologies, it is document.referrer
.
EDIT 2: Adding links requested:
document object: http://www.w3schools.com/htmldom/dom_obj_document.asp
navigator object: http://www.w3schools.com/htmldom/dom_obj_navigator.asp
As others have indicated, the HTTP headers are not available, but you specifically asked about the referer and user-agent, which are available via Javascript.