Opening Tabs and PopUp Windows

Поделиться
HTML-код
  • Опубликовано: 7 авг 2022
  • If you are opening new tabs or windows with JavaScript, this is how you can control whether it opens as a new tab or as a popup window.
    Code from Video: gist.github.co...

Комментарии • 29

  • @RajibAhmad
    @RajibAhmad 2 года назад +2

    The content you provide us for free in your channel might never be found in a course charging $10k.... cant thank you enough

  • @BrettCooper4702
    @BrettCooper4702 2 года назад +2

    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.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 года назад +1

      I recently started a playlist about this topic - ruclips.net/video/n2NeCLTUMTE/видео.html

  • @triputrafauzanhradji8005
    @triputrafauzanhradji8005 2 года назад +1

    Great video. I learned a lot from this. Thanks for sharing.

  • @keithh7994
    @keithh7994 2 года назад

    Great video as always. Always learn something.

  • @eunaogastoatoa
    @eunaogastoatoa Год назад

    thanks. not easy to find content like this

  • @kag3670
    @kag3670 2 года назад

    Thank you Nandor 👍

  • @malcolmsokol4294
    @malcolmsokol4294 Год назад

    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.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад

      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.

  • @extrapharm
    @extrapharm 2 года назад

    Excellent !!!

  • @frantardencilla8606
    @frantardencilla8606 Год назад

    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

  • @SteveCarroll2011
    @SteveCarroll2011 Год назад

    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!

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад

      A popup is what the new window is called.

    • @SteveCarroll2011
      @SteveCarroll2011 Год назад

      @@SteveGriffith-Prof3ssorSt3v3 So what you did there will always open in a new tab (there's no browser setting that can over-ride it?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад

      @@SteveCarroll2011 there used to be. There still might be in Firefox or opera. But generally no

  • @rolandohernandez3354
    @rolandohernandez3354 Год назад

    Amazing video! Question, how do I make my pop up window to appear right below the button the trigger the window?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад

      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

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад

      And if you want to learn more about screen positioning - ruclips.net/video/dxADq_DlS-w/видео.html

  • @basilicus8056
    @basilicus8056 2 года назад

    Worked, thx

  • @anilkumarpandey2294
    @anilkumarpandey2294 Год назад

    How to get the url of the opened popup window just before the close?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  Год назад

      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.

  • @snowman_web_design_development
    @snowman_web_design_development 2 года назад

    👏👏👏👏

  • @dodokwak
    @dodokwak 2 года назад

    Bedankt

  • @babulkumar6901
    @babulkumar6901 7 месяцев назад

    It's is possible to set cookie in new tab?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  7 месяцев назад

      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.