Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Semi-thoroughly hiding the URL of a popped-up page from the user

Status
Not open for further replies.

DayLaborer

Programmer
Jan 3, 2006
347
US
My superboss (i.e. boss' boss :)) asked me to do the following and I'm a bit stuck...

I need to place a link on our intranet that will open a new window to a page which is hosted externally - i.e. the HTML is not in my control. The tricky part is that I must completely hide the URL of the pop-up page. For simplicity, I'll refer to the page which (the HTML) is under my control as the intranet page and the external page to which I'm linking/displaying as the external page.

Here's the places that the URL is potentially displayed:[ol]
[li]The status bar of my intranet page[/li]
[li]The status bar of the external page (i.e. when user mouses-over links in the external page)[/li]
[li]The title bar of the external page[/li]
[/ol]

I've been working with this code:
Code:
<script language="JavaScript"> 
function OnlineCourse() 
{ 
 window.open(''[URL unfurl="true"]http://TheSecretURL.com'',''new'',[/URL]
 ''width=750, height=550, scrollbars=yes, status=no, titlebar=no, menubar=no, toolbar=no, resizable=no''); 
} 
</script>
<a href="JavaScript:OnlineCourse()">Click here</A>
...but it only addresses only issue #1.

My instructions are that although "view source" and right-clicking on the external page will display the URL, I don't need to worry about that...

Thanks!
 
Why are you using pairs of single quotes in your code example rather than just one at a time?

As for the parameters not working, try taking the spaces out of the last argument and see how that works.

Code:
width=750,height=550,scrollbars=yes,status=no,titlebar=no,menubar=no,toolbar=no,resizable=no

Lee
 
Lee, thanks for the fast reply. Same thing without the spaces. I was using pairs of single quotes because I'm storing the HTML in SQL Server - but I replaced them with regular quotes, now that you mentioned it. Same thing, though...
 
Some external pages won't let you do this, but depending on whose page it is you're linking to, you could, instead, link to a page of your own creation and have that page load this other page in a frame. Still, if the user wants to know the URL of that page, they can right-click on it and check properties.

Even if you get your method to work, if a user hits CNTL-N, a new window will open with the URL in the address bar in full view. At least, that's what I've always done when I want to see the otherwise-obscured URL (using IE).

Dave

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...east is east and west is west and if you take cranberries and stew them like applesauce
they taste much more like prunes than rhubarb does
[infinity]
 
You might want to change the name of the window from the word new since that's a reserved word in Javascript. I don't think that will affect what's happening, though.

According to Microsoft


the titlebar

Specifies whether to display a title bar for the window. This parameter is ignored unless the calling application is an HTML Application or a trusted dialog box. The default is yes.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top