how to make browser popup when a javascript triggers? [duplicate] - javascript

This question already has answers here:
Javascript Bring window to front if already open in window.open?
(8 answers)
Closed 5 years ago.
I got a javascript that fills in the modal html. I would like after that to maximize the window if it is minimized or to focus that tab if it is maximized and not focused.
Anybody knows how to do it?
Note: I'd like it to also work in older IE if possible if not I am pleased with the new one also
Thank you all!

window.open("https://www.google.com");
This will open a new window and you can change the url to suit your needs

Related

Show a popup modal on page exit using Javascript [duplicate]

This question already has answers here:
How can I detect a user about the exit the page? [closed]
(3 answers)
Closed 2 years ago.
Does anyone know if it's possible to show a popup model on page exit(close tab/refresh/go back) with images and text using Javascript/jQuery?
The closest thing I found was beforeunload but it seems to only show an alert prompt with a predefined message.
I don't think modern browsers support a custom message in the beforeunload modal popup. Check this post for a discussion on browser compatibility

Window.resizeTo not working [duplicate]

This question already has an answer here:
Javascript's `window.resizeTo` isn't working
(1 answer)
Closed 7 years ago.
I am trying to call window.resizeTo but it is not working. I read somewhere that window.resizeTo will not work until window.open is called. Can I resize the window without calling window.open using jQuery?
As you say, you cannot resize windows which you didn't create using window.open. It is not possible in modern browsers, whether you use jQuery or not.

Running an event only on browser/tab close [duplicate]

This question already has answers here:
How to Detect Browser Window /Tab Close Event?
(8 answers)
Closed 7 years ago.
I know about window.onbeforeunload, but that also executes when the user clicks on a link or refreshes the page, while I want my function to only execute when the browser or tab is closed. Is there a way to do that?
AFAIK the only options are unload and onbeforeunload so I would say the answer to your questions is "no".
https://developer.mozilla.org/en-US/docs/Web/Events/unload

How to create a pop under window behind main window in chrome? [duplicate]

This question already has answers here:
Making a window pop under in chrome
(8 answers)
Closed 7 years ago.
I want to open a pop-under window on click, but I want to open it behind the current window.
I google this and found nothing useful about my problem.
Is there a way to do it?
Perhaps a simple path setting is what you need. Use this within a javascript sequence:
path = window.document.URL;
window.open(path,"_self");

Is It possible to close window without the alert? [duplicate]

This question already has answers here:
How can I close a browser window without receiving the "Do you want to close this window" prompt?
(18 answers)
Closed 8 years ago.
When we open a form in a new window, we would like to click a button to close the window without alert box.
Is it possible?
Any help is appreciated.
Thanks alot
if you are talking about window.open() function then just try to use window.close()

Categories