Results 1 to 3 of 3

Thread: Close window

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139

    Close window

    none of these work on a .php page

    <!-- Text Link -->
    <p><a href="javascript:void(window.close())">Close Window</a></p>

    <!-- Form Button -->
    <p><input type="button" value="Close Window" name="close" onClick="window.close()"></p>

    <!-- Graphic Button -->
    <p><a href="javascript:void(window.close())"><img border="0" src="images/close_red.gif" width="93" height="23"></a></p>

    is that normal?

    If I have to make my page .html does anyone know how to display a result from a php query on a html page? maybe some kind of include??

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    As far as the browser is concerned there's no difference between a php and a normal web page. But modern IE and Mozilla alike prevent JS from closing a window that it didn't open in the first place. I think.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139
    Originally posted by CornedBee
    As far as the browser is concerned there's no difference between a php and a normal web page. But modern IE and Mozilla alike prevent JS from closing a window that it didn't open in the first place. I think.
    Ok I have worked out it the way my page is getting displayed



    <script>


    // set the popup window width and height

    var windowW=214 // wide
    var windowH=398 // high

    // set the screen position where the popup should appear

    var windowX = 260 // from left
    var windowY = 100 // from top

    // set the url of the page to show in the popup

    var urlPop = "photo.html"

    // set the title of the page

    var title = "This Is A Frameless Popup Window"

    // set this to true if the popup should close
    // upon leaving the launching page; else, false

    var autoclose = true



    s = "width="+windowW+",height="+windowH;
    var beIE = document.all?true:false

    function openFrameless(){
    if (beIE){
    NFW = window.open("","popFrameless","fullscreen,"+s)
    NFW.blur()
    window.focus()
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
    var frameString=""+
    "<html>"+
    "<head>"+
    "<title>"+title+"</title>"+
    "</head>"+
    "<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
    "<frame name='top' src='"+urlPop+"' scrolling=auto>"+
    "<frame name='bottom' src='about:blank' scrolling='no'>"+
    "</frameset>"+
    "</html>"
    NFW.document.open();
    NFW.document.write(frameString)
    NFW.document.close()
    } else {
    NFW=window.open(urlPop,"popFrameless","scrollbars,"+s)
    NFW.blur()
    window.focus()
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
    }
    NFW.focus()
    if (autoclose){
    window.onunload = function(){NFW.close()}
    }
    }

    </script>

    <a href="javascriptpenFrameless()"><img border="0" align="center" src="<?php echo $row["url"];?>" width="200" height="150">

    when i display the page photo.php it closes fine, I i get it to pop up it does not work. any ideas why?

Posting Permissions

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



Click Here to Expand Forum to Full Width