[thelist] Javascript referrer in IFRAME?

.jeff jeff at members.evolt.org
Wed Oct 10 13:07:00 CDT 2001


emmet,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Emmet McGovern
>
> My java person is out for a few days and i need some help.
>
> [...]
>
> Anyone know how to put a referrer in an <iframe> using
> java?
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

you mean javascript?

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> I tried this but it doesnt seem to work.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

the simplest way would be to include the iframe in your page without a src
attribute using normal html.  then, using script when the page finished
loading (triggered using the onload event handler) change the location of
the iframe to the url you desire, including the referrer.

is there a particular reason why you need to use an iframe though?  it looks
to me like you're just trying to record the referrer?  if so, you could get
better browser support by doing an image swap with a 1x1 pixel image
changing the src of the image to the url you're using for the iframe.

since you're using coldfusion though, there isn't any need to use javascript
at all.  just use the http_referer variable in the cgi scope.

<iframe

src="http://shop.beachin.net/applications/refer.cfm?id=12345&refer=#cgi.http
_referer#">

lastly, does your web server not already log referrers?  and if you don't
have access to these logs (which are far more accurate and sophisticated
than using javascript), why not?

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thelist mailing list