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?


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?