Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Get the referrer in jQuery
jQuery.fn.referrer = function() {
return jQuery(document).prop("referrer").toString();
};
//usage:
jQuery().referrer()
@SeanJA
Owner
SeanJA commented Oct 3, 2012

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

@kitcambridge

Needs more function calls...

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

Voilà!

@SeanJA
Owner
SeanJA commented Oct 4, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.