ie & referer header

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aziz

    #1

    ie & referer header

    hi,

    when I load a new page with location.href, ie doesn't set the http
    referer header while firefox&mozilla does...
    I tried the click() method on a hidden link, this times it works on ie,
    but firefox says that click is not a function
    [...
    <a id="ref" href.......>... </a>
    ....
    document.getEle mentById("ref") .click();
    ....]
    Is there any method which I can set this header manualy or make ie set
    it properly? Or any other idea?

    Thanks
  • Paul R

    #2
    Re: ie &amp; referer header

    Aziz wrote:[color=blue]
    > hi,
    >
    > when I load a new page with location.href, ie doesn't set the http
    > referer header while firefox&mozilla does...
    > I tried the click() method on a hidden link, this times it works on ie,
    > but firefox says that click is not a function
    > [...
    > <a id="ref" href.......>... </a>
    > ...
    > document.getEle mentById("ref") .click();
    > ...]
    > Is there any method which I can set this header manualy or make ie set
    > it properly? Or any other idea?
    >
    > Thanks[/color]

    var targetLink = document.getEle mentById("ref") ;
    if(targetLink.c lick) // check function exists
    {
    targetLink.clic k();
    }
    else
    {
    // if no, replace location
    self.location = targetLink.getA ttribute("href" );
    }

    While this does what you ask and illustrates a standard way to check for
    a function before executing it, I'm not sure I'd recommend the approach.

    If you need the referrer for some scripting reason in the target page,
    why not include the referring URL as a parameter in the web address?

    self.location = 'newpage.htm?re ferrer=' + self.location.h ref;

    and, in the target page:

    var referrer = self.location.s earch.substring (10);

    Comment

    Working...