Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

close pop-up automatically

Featured Replies

this code i've written works in explorer, but not in any other browsers ive tested it in (firefox etc)

 

<p><a href="website.com" target="_blank" value="Close this window" onclick="self.close()" >For more detailed information</a></p>

 

it is supposed to work is when people want brief information, they click on a link which produces a pop-up window, within that pop-up is the above code. What i want to happen is you click on the 'for more detailed information' link and the pop-up closes and a new window opens with the detailed information

 

to see what i mean its on this page http://www.grooming-health.com/zdesign.htm if you click on the 'our promise button' you'll see what i mean

 

can anybody tell me why its only working in explorer

thanks

  • Author

bump

 

if anybody know why its not working and how i fix it, it would be a great help

 

thanks

Seth

Hi Seth,

 

The close functionality in firefox is disabled for security reasons, by default.

 

You can change it in settings by setting ”dom.allow_scripts_to_close_windows” to true but obviously this is good for your remote users.

 

Your problem is one many face however there is not a solution that I'm aware of. The rule firefox and many other browsers now go by is you can only close a window with JavaScript that you opened with JavaScript. If your visitor opened the window then you can't close it.

 

Cheers,

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.