How to open HTML in only one Window/Tab

Amandeep Jiddewar

What I want to do -

1) On Click of a button I will open a new window(popup).

2) When I click on same button, If the window(popup)is already open I will not open it again instead bring the previously opened window(popup) on top of all windows.

3) If popup is not open I will use window.open() to open a popup.

What I did till now -

1) On Click of a button I will open a new window(popup).

2) Problem : How do I not allow opening of new window on click of button if window is already open?

Mark Topper

Here you go:

Javascript function:

<script language="javascript" type="text/javascript">
function popitup(url) {
    newwindow=window.open(url,'name','height=200,width=150');
    if (window.focus) {newwindow.focus()}
    return false;
}
</script>

HTML tag:

<a href="popupex.html" onclick="return popitup('popupex.html')">Link to popup</a>

Source: http://www.quirksmode.org/js/popup.html
Please take a look at the source for this and how they got it to work. They do also have some examples of exactly what you need.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to open only 1 accordion at one time

From Dev

How to open a collection item only on one client?

From Dev

How to open only one sub menu at a time

From Dev

How to have Firebug only open in one tab

From Dev

How to open only one sub menu at a time

From Dev

How do you allow only one instance of an inherited window to be open?

From Dev

how to open only one window in c# winform

From Dev

Bootstrap Dropdowns: How to trigger on hover, but only when one is already open

From Dev

Open only one slider at a time

From Dev

Open only one slider at a time

From Dev

Only one dropdown open at a time

From Dev

Only open one infowindow at a time

From Dev

c# - How to open a html file in a web browser that is not the default one?

From Dev

How to open another submit form after submitting one on html or javascript?

From Dev

How do you apply a style to only one div in the HTML?

From Dev

How can I call only one line of an html file?

From Dev

How can one have many HTML5 pages with only one navigation bar code page using ONLY html and CSS?

From Java

Logic to keep only one section open at a time

From Dev

Open only one instance of a text file

From Dev

Open only one infowindow at a time google maps

From Dev

SlickNav jQuery plugin - only one open menu

From Dev

Setting only one div to open on slide toggle

From Dev

Bootstrap Accordion - Only one open at a time

From Dev

Is it possible for Eclipse to only open one JFrame?

From Dev

Configure eclipse to open only one class

From Dev

Open only one infowindow at a time google maps

From Dev

Setting only one div to open on slide toggle

From Dev

Bootstrap Accordion - Only one open at a time

From Dev

Only one bootstrap dropdown menu open at a time

Related Related

  1. 1

    How to open only 1 accordion at one time

  2. 2

    How to open a collection item only on one client?

  3. 3

    How to open only one sub menu at a time

  4. 4

    How to have Firebug only open in one tab

  5. 5

    How to open only one sub menu at a time

  6. 6

    How do you allow only one instance of an inherited window to be open?

  7. 7

    how to open only one window in c# winform

  8. 8

    Bootstrap Dropdowns: How to trigger on hover, but only when one is already open

  9. 9

    Open only one slider at a time

  10. 10

    Open only one slider at a time

  11. 11

    Only one dropdown open at a time

  12. 12

    Only open one infowindow at a time

  13. 13

    c# - How to open a html file in a web browser that is not the default one?

  14. 14

    How to open another submit form after submitting one on html or javascript?

  15. 15

    How do you apply a style to only one div in the HTML?

  16. 16

    How can I call only one line of an html file?

  17. 17

    How can one have many HTML5 pages with only one navigation bar code page using ONLY html and CSS?

  18. 18

    Logic to keep only one section open at a time

  19. 19

    Open only one instance of a text file

  20. 20

    Open only one infowindow at a time google maps

  21. 21

    SlickNav jQuery plugin - only one open menu

  22. 22

    Setting only one div to open on slide toggle

  23. 23

    Bootstrap Accordion - Only one open at a time

  24. 24

    Is it possible for Eclipse to only open one JFrame?

  25. 25

    Configure eclipse to open only one class

  26. 26

    Open only one infowindow at a time google maps

  27. 27

    Setting only one div to open on slide toggle

  28. 28

    Bootstrap Accordion - Only one open at a time

  29. 29

    Only one bootstrap dropdown menu open at a time

HotTag

Archive