Click to See Complete Forum and Search --> : HELP PLZ! a window that removes its toolbar, menubar etc by it self


joshk2000
12-03-2003, 01:24 PM
hi im new :) and creating a 'send this link to a friend page'

I have a question that is driving me crazy.

I have a page that uses dreamweavers popup window behavior to launch a NEW window. this window has no scroll, menu,toolbar etc and it gets those attributes from the link on the main site. the window opens fine and looks good, except one problem, i can get the file name of the window that launched it (using coldfusions CGI.HTTP_REFERER)... It seems that when i use this dreamweaver function the window that launched it - in this case ill call it the REFERING WINDOW - is not recognized by the popup window. So basically i cant get the REFERING window file name. which i obviously need inorder to send the link to a friend.

What DOES work...
I can simply create a link to the 'sendthis link to a friend file' and have it target a _blank document and THEN i can use CGI.http_referer to get the name of the file.


BUT...
when i do this the window has all the toolbars etc on it since it wasnt launched from a function that built the window with them removed- and i dont want them because they look ugly.
SO...
is there a way for that window to "self removev the toolbars etc? this way i could pass the proper info on from the REFERING window and still have it look nice.

thank you very much in advance ( not refering to time but the amount of thanks that i offer)

ALSO...
can you explain the difference between using a function to launch a window with a function VS linking to a new document using target _ Blank?

Josh

Have a good one.

AdamGundry
12-03-2003, 03:16 PM
To comply with accessibility recommendations, you should not be using popups at all, but I'll leave that one go.

Javascript cannot remove browser toolbars or alter the chrome, for security reasons.

You cannot rely on HTTP_REFERER being set correctly because it is passed by the browser, and so can be altered in some circumstances by the user. As you have seen, opening a popup with Javascript does not set it, nor should it.

Instead, you could try using a normal link, passing the page to be sent using a GET parameter, for example using something like:

<a href="sendlink.cgi?link=page1.htm" onclick="window.open(this.href); return false;">Send link to a friend</a>

Adam

joshk2000
12-03-2003, 03:43 PM
thanks for your reply, i ended up figureing it out, but i do have a few questions for you that i would appreciate if you could clear up - just for my own learning purposes in which i appreaciate your time and knowledge!

i ended up goin with something that is similar to what you recoemmeded. I'm still using the function to open the window, because it allows me to reomove the toolbars (which i dont quite understand why you said it couldnt) but i - as you recomended - pass the main pages file name thru the URL string

onClick="MM_openBrWindow('sendToFriend.cfm?link=<cfoutput>#thisPage#</cfoutput>','sendFriend','location=yes,width=400,height=350')"

--question time--
1.how the data be manipulated by the user when using HTTP_REFERER? It seems to me that if anything was subject to manipulation it would be the string that is visibly passed in the URL string.

2.what makes you say that javascript cannot control the look of a window as far as toolbars go? and you were saying that i doesnt pass information along to new windows, but thats exactly what its doing when a function creates a toolbar-less window isnt it?

3.regarding complying with accessability issues...are you refering to people with popup blockers? If so, i guess my thoughts are that they are probably used to keeping an eye out for the alert that the browser gives them when a window is blocked. such as Firebird does.
--------------------

Thanks Adam,

I look forward to your reply, and again have a great evening.

Josh

AdamGundry
12-04-2003, 11:36 AM
1. Some browsers allow you to change HTTP_REFERER; MSIE does not, but I believe Mozilla/Firebird can be hacked so it does, and I believe others do not set it at all, for example if they still use HTTP/1.0 instead of 1.1. It's not terribly important, but it could cause problems for some users.

2. Sorry, I should have been clearer. JS cannot alter the current window in any way, but in popups that it creates you can control the chrome that is initially visible.

3. Popups cause problems for people with disabilities, for example people using a screen reader (which can get confused with popup windows). In addition, popup-blockers may cause unexpected behaviour, as you described. From the Web Content Accessibility Guidelines:
10.1 Until user agents allow users to turn off spawned windows, do not cause pop-ups or other windows to appear and do not change the current window without informing the user.
Adam

joshk2000
12-04-2003, 11:43 AM
Cool,

thanks for clearing that up.

take care Adam.

------------------------------
Josh