473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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.getElementById("ref").click();
....]
Is there any method which I can set this header manualy or make ie set
it properly? Or any other idea?

Thanks
Jul 23 '05 #1
1 2540
Aziz wrote:
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.getElementById("ref").click();
...]
Is there any method which I can set this header manualy or make ie set
it properly? Or any other idea?

Thanks


var targetLink = document.getElementById("ref");
if(targetLink.click) // check function exists
{
targetLink.click();
}
else
{
// if no, replace location
self.location = targetLink.getAttribute("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?referrer=' + self.location.href;

and, in the target page:

var referrer = self.location.search.substring(10);
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jawahar rajan | last post by:
All, I have a question about the Max Referer length. By default this is 256 I am not fully sure I understand this property. It this a header that is sent back to the Server by a client and is it...
0
by: Stuart | last post by:
Hi Is there any way to prevent an IE 6 browser from sending up the REFERER HTTP header ? (Either as an IIS Server setting, change to asp files, or even a setting in the IE browser). This is...
5
by: mike | last post by:
regards: Does each HTTP Request have "Referer:" header? Any positive suggestion is welcome. thank you May goodness be with you all
7
by: andri.wardhana | last post by:
Hi Guys, I have a problem with my ASP file. since I'm all new in ASP, i found that the error statement generated by ASP is confusing. basically what I want to do in this script is ability to...
8
by: Du | last post by:
I'm trying to automate the upload process to yousendit.com, but the file size doesn't add up and yousendit.com keep rejecting my upload (it accepts the upload until the very end) I don't know...
4
by: Milan Negovan | last post by:
Is there way to modify the "Headers" collection of the HttpRequest class? Basically, I need to somehow clear the "Referer" header. Any ideas will be much appreciated! Thanks!
1
by: Al | last post by:
Hi i'm having troble with a script where i check referer, on a PC with Zone Alarm Pro the referer isn't send... i did a couple of page of testing and no referer is sand, closing ZAP the...
4
by: pavloutefkros | last post by:
Hello all! I was wondering, if there is a way to retrieve the referer url with python (web-based). I tried this: import os print os.getenv('HTTP_REFERER') but it's not working, even...
2
by: Harsha | last post by:
Hi, Is there any way to set the referer header manually/automatically while redirecting users to other websites so that the $_SERVER; shows the referer set by me. Please help... Thanks,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.