SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2006
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Verify window opening.

    Hi all,

    I've a windows to be opened when i click on a link provided. How do i verify that the window is opened or not?? If the window is opened it should not open again. I've used the below script to open the window. Please help.


    Code:
    echo "<td><tt><center><a href=\"#\" onclick=\"hint_wnd = window.open('', 'hint_wnd', 'width=300, height=300, resizable=no, scrollbars=no,left=500,top=500' );hint_wnd.document.write( '<b>Audio Expected Result:</b>   $expaud' );return true;target=newWin;\">View</a></center></td>";

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hind_wnd will be null if the window doesn't open.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2006
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can u plz tell me how do i check for that in javascript as i'm using php and not knowing much about javascript.


    Quote Originally Posted by AutisticCuckoo
    hind_wnd will be null if the window doesn't open.

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    if (hind_wnd == null) {
      /* window did not open */
    } else {
      /* it's OK, go ahead and use the window */
    }
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Zealot
    Join Date
    Mar 2006
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no,man. after placing your code the contents in the window is repeated after i click the second time.



    Quote Originally Posted by AutisticCuckoo
    Code:
    if (hind_wnd == null) {
      /* window did not open */
    } else {
      /* it's OK, go ahead and use the window */
    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •