|
-
Jan 28th, 2003, 02:17 AM
#1
document.referer? *resolved*
A hyperilnk like this:
Code:
<a href="#" onClick="javascript:winopen();"><img border="0" src="/images/tellafriend.gif" alt="Tell a Friend"></a>
Where winopen() is like this:
Code:
<script language="javascript">
function winopen(){
win = window.open("/tellafriend.php", "newWin", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=300,height=160")
}
</SCRIPT>
Now, in that tiny little tellafriend.php window, how do I get a hold of the refering page?
Last edited by mendhak; Jan 28th, 2003 at 06:48 AM.
-
Jan 28th, 2003, 02:21 AM
#2
document.referer is coming undefined for me.
-
Jan 28th, 2003, 02:29 AM
#3

If I use document.referrer (note the spelling change), it gives me a blank.
My second question is: what is the correct spelling? referer or referrer?
-
Jan 28th, 2003, 04:15 AM
#4
A reference to the window that opened the page.
-
Jan 28th, 2003, 05:52 AM
#5
Originally posted by DeadEyes
A reference to the window that opened the page.
I'm getting
-
Jan 28th, 2003, 06:04 AM
#6
You've got the parent window object
say the parent has a form called frm
and a input called txt
now you can get and set the value of the parent's text
Code:
alert(window.opener.document.frm.txt.value)
-
Jan 28th, 2003, 06:27 AM
#7
Frenzied Member
He want's the opening window's URI, not a text box's value, so it would be more like this I think:
Code:
window.opener.document.URL
Also I think it's one R in referer, and some versions of IE have trouble offline, but as DeadEyes has said you want window.opener in this case.
-
Jan 28th, 2003, 06:47 AM
#8
Originally posted by Rick Bull
Also I think it's one R in referer
So either the javascript folks (document.referrer) or the PHP folks ($HTTP_REFERER) need to get their english straight. 
Thanks...
-
Jan 28th, 2003, 11:06 AM
#9
Frenzied Member
Yep, and looks, I even found a definition on dictionary
-
Jan 28th, 2003, 08:32 PM
#10
<World-Wide Web> A misspelling of "referrer" which somehow
made it into the HTTP standard. A given web page's
referer (sic) is the URL of whatever web page contains the
link that the user followed to the current page. Most
browsers pass this information as part of a request.
Leave it to web designers to screw up the world
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|