Posted By

xzkcz on 02/11/09


Tagged

referrer


Versions (?)

getRef


 / Published in: JavaScript
 

  1. function getRef(){
  2. var ref = '';
  3. if (document.referrer.length > 0) {
  4. ref = document.referrer;
  5. }
  6. try {
  7. if (ref.length == 0 && opener.location.href.length > 0) {
  8. ref = opener.location.href;
  9. }
  10. } catch (e) {
  11. }
  12. return ref;
  13.  
  14. }

Report this snippet  

You need to login to post a comment.