Skip to content

Instantly share code, notes, and snippets.

@SeanJA
Forked from gavinblair/jquery.referrer.js
Created October 5, 2012 19:23
Show Gist options
  • Save SeanJA/3841821 to your computer and use it in GitHub Desktop.
Save SeanJA/3841821 to your computer and use it in GitHub Desktop.
Get the referrer with jQuery: A useless bookmarklet
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.7.2",function($,L){$.fn.referrer%20=%20function()%20{%20%20%20%20return%20$(document).prop("referrer").toString();};alert($().referrer());});
@SeanJA
Copy link
Author

SeanJA commented Oct 5, 2012

Now it doesn't require javascript

@gavinblair
Copy link

I hope you mean it doesn't require jQuery :P

@gavinblair
Copy link

We should make it so it loads in jQuery UI so that it can be a modal dialog instead of an alert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment