What's new

Welcome to the forum 👋, Visitor

To access the forum content and all our services, you must register or log in to the forum. Becoming a member of the forum is completely free.

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

Nemo2000

New member
Joined
Nov 16, 2023
Messages
1
Reaction score
0
HTML Coins
0
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:

Theme customization system

You can customize some areas of the forum theme from this menu.

  • Wide/Narrow view

    You can control a structure that you can use to use your theme wide or narrow.

    Grid view forum list

    You can control the layout of the forum list in a grid or ordinary listing style structure.

    Picture grid mode

    You can control the structure where you can open/close images in the grid forum list.

    Close sidebar

    You can get rid of the crowded view in the forum by closing the sidebar.

    Fixed sidebar

    You can make it more useful and easier to access by pinning the sidebar.

    Close radius

    You can use the radius at the corners of the blocks according to your taste by closing/opening it.

  • Choose the color combination that reflects your taste
    Background images
    Color gradient backgrounds
Back