Skip to content Skip to sidebar Skip to footer

How To Hide Url In The Popup Window Opened Using Window.open

I am using below code to open a popup window in my page: window.open('myPopupWindow.html', '_blank', 'height=400, width=550, status=yes, toolbar=no, menubar=no, location=no, addres

Solution 1:

Are you just trying to mask the address, to make it look nicer or hide the fact that you're linking to to another website, or is it that you don't want people to know they can access that page without using your popup?

If it's the former, then what you could do is make the page you open in window.open an iframe, and point the iframe to your actual page. They user could still access the target page, but only via your nicer looking url.

The other option is to use something like a colorbox with an iframe instead of window.open, which will mask the address. Have a look at the Outside Webpage (iframe) example on this page.

Of course whichever option you choose, someone smart can still track down the target url via the source code and go there directly.

Solution 2:

window.open('http://mysite/proxy.html')

and in proxy.html :

<html><body><iframesrc="/realPage.html"></iframe></body></html>

Solution 3:

Simple solution open new tab after that add url to location.href.

window.open('','_blank').location.href = "url"

Post a Comment for "How To Hide Url In The Popup Window Opened Using Window.open"