public
Created

Get the referrer in jQuery

  • Download Gist
jquery.referrer.js
JavaScript
1 2 3 4 5 6
jQuery.fn.referrer = function() {
return jQuery(document).prop("referrer").toString();
};
 
//usage:
jQuery().referrer()

This is a joke... don't use this

Needs more function calls...

return jQuery(document).prop("referrer");

VoilĂ !

@kitcambridge I added your fix, also added a toString... just to make sure it really is for realz a string

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.