Would love to see more about inter-window communications. The idea being for multi window systems where you can having control and status displayed on the second screen. This could be for like a slideshow.
You can use the click event or the button that was clicked to get your x and y position on the screen. Then when you call the open method, in the options object you can add values for the top and left properties to say where you want to appear. developer.mozilla.org/en-US/docs/Web/API/Window/open
I have a similar window.open call without anything set as to origin or type. Displays lines of text with some dynamic values read from a text file. It appears I have created a small window in its own tab and the only way to close it is to use the close window X in upper right. This window remains open even if the parent (calling window) looses focus or is closed however. I want the popup to be closed as noted but also to close if the parent window closes or looses focus. In other words, if the only window remaining open in my browser is the popup, I want to insure it closes when the parent window closes for sure but also if someone navigates to another page in the website open when the popup was created, to make sure the popup is closed out.
Creating a new window creates a new object that exists on its own, it is able to communicate with its creator but it is not tied to or connected to the creator in any permanent way. If you want the creator to close the window that it opened, when it is closed, then you should use the onbeforeunload or pagehide event as the trigger to call a function that closes any window(s) that it opened.
When you call window.open() you get a reference to the opened window as a return value. That reference is a window object with all the same properties as any window, including location. unload and beforeunload and pagehide and changevisibility are all events that you can tap into when tabs blur and close.
cookies are connected to domains. If the tab that you open is loading a page from the same domain then it will have access to cookies that you set in the original script.
The content you provide us for free in your channel might never be found in a course charging $10k.... cant thank you enough
Would love to see more about inter-window communications. The idea being for multi window systems where you can having control and status displayed on the second screen. This could be for like a slideshow.
I recently started a playlist about this topic - ruclips.net/video/n2NeCLTUMTE/видео.html
thanks. not easy to find content like this
Great video. I learned a lot from this. Thanks for sharing.
Amazing video! Question, how do I make my pop up window to appear right below the button the trigger the window?
You can use the click event or the button that was clicked to get your x and y position on the screen.
Then when you call the open method, in the options object you can add values for the top and left properties to say where you want to appear.
developer.mozilla.org/en-US/docs/Web/API/Window/open
And if you want to learn more about screen positioning - ruclips.net/video/dxADq_DlS-w/видео.html
Great video as always. Always learn something.
I have a similar window.open call without anything set as to origin or type. Displays lines of text with some dynamic values read from a text file. It appears I have created a small window in its own tab and the only way to close it is to use the close window X in upper right. This window remains open even if the parent (calling window) looses focus or is closed however. I want the popup to be closed as noted but also to close if the parent window closes or looses focus. In other words, if the only window remaining open in my browser is the popup, I want to insure it closes when the parent window closes for sure but also if someone navigates to another page in the website open when the popup was created, to make sure the popup is closed out.
Creating a new window creates a new object that exists on its own, it is able to communicate with its creator but it is not tied to or connected to the creator in any permanent way.
If you want the creator to close the window that it opened, when it is closed, then you should use the onbeforeunload or pagehide event as the trigger to call a function that closes any window(s) that it opened.
Isn’t the decision for it to open in a new tab or new window (not a pop up window) a browser setting? Great video, btw!
A popup is what the new window is called.
@@SteveGriffith-Prof3ssorSt3v3 So what you did there will always open in a new tab (there's no browser setting that can over-ride it?
@@SteveCarroll2011 there used to be. There still might be in Firefox or opera. But generally no
please@@SteveGriffith-Prof3ssorSt3v3
Hi, thanks for the video. Is there any way to set a min-width on the pop up window? so the user can´t make it any smaller than the value provided
You can pass a parameter for the initial size but you can't stop the user from resizing the window
Thank you Nandor 👍
Excellent !!!
How to get the url of the opened popup window just before the close?
When you call window.open() you get a reference to the opened window as a return value.
That reference is a window object with all the same properties as any window, including location.
unload and beforeunload and pagehide and changevisibility are all events that you can tap into when tabs blur and close.
Worked, thx
It's is possible to set cookie in new tab?
cookies are connected to domains. If the tab that you open is loading a page from the same domain then it will have access to cookies that you set in the original script.
👏👏👏👏
Bedankt
...en jij ook bedankt!
...oder Danke dir auch
@@SteveGriffith-Prof3ssorSt3v3 Thanks. (You are right, it was in Dutch)