What's new
HTML Forums | An HTML and CSS Coding Community

Welcome to HTMLForums; home of web development discussion! Please sign in or register your free account to get involved. Once registered you will be able to connect with other members, send and receive private messages, reply to topics and create your very own. Our registration process is hassle-free and takes no time at all!

How to hide the address bar in a popup window in HTML?

Nemo2000

New member
As a rather poorly self-taught use of HMTL, I can do the basics but struggle sometimes to work out more complicated stuff, so please bear with me.


I have created a simple HTML file (call it A) with some content that I want to display as a 'popup' whenever someone clicks on a link in other HTML pages (call them B, C etc). Working from various online web tutorials etc I have managed to create a Javascript file (call it X) which creates a series of 'classes' of different sizes of popup windows. So far so good - the user clicks on a link in say file B or C and file A appears in a popup window. BUT - how can I hide the address bar in the popup window so that the URL of file A is hidden?


Web searches for this query give various answers relating to the use of "location=no" or "location=0" or similar, but no guide as to exactly where that value has to be inserted. Everything I have tried so far has failed.


The various files B, C etc each contain the following code:-


<script type="text/javascript" src="popup.js"></script>


where 'popup.js' is File X mentioned above


and then:-


<a class="popup1" href="datafile.html" onclick="window.open(datafile.html)">Click Here</a>


where 'datafile' is File A mentioned above and 'popup1' is one of the classes defined in File X.


Hopefully that's clear! If so, can anyone help please?
 
The problem is that modern browsers focus on implementing security and transparency to their users. window. Open is the proper JavaScript call but most browsers may ignore the request for a frameless browser window.

In terms of using JavaScript, you may have better luck using a JavaScript framework such as React or Vue.js. They may offer more versatility but unfortunately, I do not think JavaScript alone may not be able to help with this.

Another option would be to use a frameless overlay. You can create a div element or some other element and utilize custom styling to "function" or "look like" a frameless window but this not be the option you are looking for either.
 
The problem is that modern browsers focus on implementing security and transparency to their users. window. Open is the proper JavaScript call but most browsers may ignore the request for a frameless browser window.

In terms of using JavaScript, you may have better luck using a JavaScript framework such as React or Vue.js. They may offer more versatility but unfortunately, I do not think JavaScript alone may not be able to help with this.

Another option would be to use a frameless overlay. You can create a div element or some other element and utilize custom styling to "function" or "look like" a frameless window but this not be the option you are looking for either.
I think just spoke in extraterrestrial language to Nemo2000. I don't think he understood all what you said.

Nemo2000. If you started using Javascript. Learn about jQuery. ( jquery.com ) (it's a simplified/shorter version of Javascript)


You will need to learn basically 3 things to do a lot of things in websites.
  1. HTML
  2. CSS
  3. Javascript (I recommend learning jQuery )
With those 3 things, you can do what you asked in this thread and way more cool stuff.
 
Last edited:
Back
Top