• eagardiner

    (@eagardiner)


    Hello, I am using AWS for my site and would like to change the formatting of certain pages depending on the internal referrer page. I have tried document.referrer inside ajaxComplete() but it is empty and $_SERVER[‘HTTP_REFERER’] but it gives the URL of the current page not the previous page. Does anyone have a suggestion for how I might achieve this please? Many thanks.

    • This topic was modified 6 years ago by eagardiner.
Viewing 1 replies (of 1 total)
  • davewoodhall

    (@davewoodhall)

    I don’t know how comfortable you are with JavaScript, but I would do something like this.

    jQuery(document).ready(function(){
    // use a custom var as tracker
    var previousPage = “”;

    jQuery.ajax({
    cback:function(d){
    console.log(d);
    // get info in “d” and work with the value of previousPage;
    }
    });
    });

    I don’t have the exact variable names but I believe somewhere in there you will have more information. Otherwise, you can use plain javascript to get the window.location to update said variable and work from there.

    Hope this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Document referrer’ is closed to new replies.