By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,769 Members | 1,382 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,769 IT Pros & Developers. It's quick & easy.

document.referrer..

P: n/a

if I put alert(document.referrer) in code of a file that was linked from
another it returns blank... pls, need to get document.referrer, don't
why it's not working... read up on oreilly, don't know what I'm doing
wrong.. thank you.. Frances
Jul 23 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
"Frances Del Rio" <fd***@yahoo.com> wrote in message
news:39*************@individual.net...

if I put alert(document.referrer) in code of a file that was linked from
another it returns blank... pls, need to get document.referrer, don't
why it's not working... read up on oreilly, don't know what I'm doing
wrong.. thank you.. Frances


Try "referer".

Also, it may be blocked by many firewalls.
Jul 23 '05 #2

P: n/a
In article <39*************@individual.net>, fd***@yahoo.com enlightened us
with...

if I put alert(document.referrer) in code of a file that was linked from
another it returns blank... pls, need to get document.referrer, don't
why it's not working... read up on oreilly, don't know what I'm doing
wrong.. thank you.. Frances


Referer is spelled (incorrectly, but that's a long story):
document.referer

Note that is should NEVER be relied upon. It is not accurate and can easily
be spoofed. I spoof it all the time to get into stuff. ;)

--
--
~kaeli~
Not one shred of evidence supports the notion that life is
serious.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3

P: n/a


McKirahan wrote:
"Frances Del Rio" <fd***@yahoo.com> wrote in message
news:39*************@individual.net...
if I put alert(document.referrer) in code of a file that was linked from
another it returns blank... pls, need to get document.referrer, don't
why it's not working... read up on oreilly, don't know what I'm doing
wrong.. thank you.. Frances

Try "referer".

Also, it may be blocked by many firewalls.


thank you.. I did try "referer", it returns "undefined".. don't know
about the firewall thing since here at work we use referrer checking
w/asp and it works.. needed to do client-side.. but found another
solution for what I needed to do.. however, still would like to know
why this thing isn't working b/c sooner or later will need to use
client-side again.. thank you again.. Frances

Jul 23 '05 #4

P: n/a
kaeli wrote:

Referer is spelled (incorrectly, but that's a long story):
document.referer


"document.referrer" works for me.

[...]
Mick
Jul 23 '05 #5

P: n/a
I always use "document.referrrrrer". Very nice.

Jul 23 '05 #6

P: n/a
In article <lO*******************@twister.nyroc.rr.com>,
mw***********@rochester.rr.com enlightened us with...
kaeli wrote:

Referer is spelled (incorrectly, but that's a long story):
document.referer


"document.referrer" works for me.

[...]

Sorry, the header is called referer.
Perhaps javascript does use the correct spelling to access it. My bad.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

--
--
~kaeli~
Do not taunt Happy Fun Ball!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #7

P: n/a
Frances Del Rio wrote:

if I put alert(document.referrer) in code of a file that was linked from
another it returns blank... pls, need to get document.referrer, don't
why it's not working... read up on oreilly, don't know what I'm doing
wrong.. thank you.. Frances


SWAG: You are testing it in IE offline. IE does not report the referrer
property when testing a page offline.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #8

P: n/a


Randy Webb wrote:
Frances Del Rio wrote:

if I put alert(document.referrer) in code of a file that was linked
from another it returns blank... pls, need to get document.referrer,
don't why it's not working... read up on oreilly, don't know what I'm
doing wrong.. thank you.. Frances


SWAG: You are testing it in IE offline. IE does not report the referrer
property when testing a page offline.


this is interesting.. had no idea and hadn't thought of that... I WAS
testing locally, and I need it for a CD.. referrer URL would be locally
from same CD.. oh well.. many thanks to all for your responses... Frances

Jul 23 '05 #9

P: n/a
Some virus checker/security/privacy software packages like some
versions of Norton completely block the browser sending the referrer
too.

Jul 23 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.