How to get HTTP-Referer via JS | Jquery?
Asked Answered
H

1

32

Is it possible to get the http-referer of visitors via pure JS or with JQuery?

Hydroxyl answered 3/11, 2014 at 14:59 Comment(1)
document.referrer...Hoff
S
66

Yes. Just use document.referrer.

Shrive answered 3/11, 2014 at 15:1 Comment(3)
A direct link doesn't have a referer anyways.Shrive
you are faster, damn :DHalfblood
@Shrive Not true about "direct link doesn't have referer". New Rules here tools.ietf.org/html/rfc7231#section-5.5.2 Must be about:blankHydroxyl

© 2022 - 2024 — McMap. All rights reserved.