问题描述
window.open(myPopupWindow.html ,_blank,height = 400,width = 550,status = yes,toolbar = no,menubar = no,location = no,addressbar = no,top = 200,left = 300);
虽然网址已被禁用,但即使此时也可以看到并复制。我已经将地址栏设置为no。如何隐藏网址到弹出窗口?
你只是想掩盖地址,使它看起来更好或隐藏事实上,你链接到另一个网站,或者你不希望人们知道他们可以访问该网页,而无需使用弹出?
如果它是前者,那么你可以做的是让你在window.open打开的页面打开一个iframe,并将iframe指向你的实际页面。他们的用户仍然可以访问目标页面,但只能通过你看起来更漂亮的url。
另一种选择是使用类似于带有iframe的colorbox而不是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, addressbar=no, top=200, left=300");
Although the url is disabled but even then it can be seen and copied. I have already set addressbar to no. How can I hide url in popup window?
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.
这篇关于如何在使用window.open打开的弹出窗口中隐藏url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!