SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy referrer redirect gives error

    Hi
    I want to redirect people coming from certain pages to a page on my site especially for them. I always get this error:

    Error: setting a property that has only a getter


    This is the script:

    Code:
    function redirect() {
    var s=0;
    var spirit= new Array(4);
    spirit[0]="http://www.theorderoftime.com/personal/c/eastern.html";
    spirit[1]="http://www.plotinus.com/links8_metaphysical.htm"
    spirit[2]="http://www.aham.com/experience/links.html"
    spirit[3]="http://www.synchronicity.org/shopcontent.asp-type-spiritualresources"
    
    if   (document.referrer = spirit[s]) { 
          location.href = "http://www.wideopenwin.com/index.php?NodeID=235";
    }
    }
    
    addLoadListener(redirect);
    What am i doing wrong?

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    using a single = is to set, using a double = is to check.

    if(document.referrer == sprits[s])


  3. #3
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Of course!!!!
    Thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •