Created
October 3, 2012 22:44
-
-
Save SeanJA/3830362 to your computer and use it in GitHub Desktop.
Get the referrer in jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.fn.referrer = function() { | |
return jQuery(document).prop("referrer").toString(); | |
}; | |
//usage: | |
jQuery().referrer() |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a joke... don't use this