Popup window not closing using window.close

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmorand
    New Member
    • Sep 2007
    • 219

    Popup window not closing using window.close

    I can't seem to get my popup windows to close properly in IE. They close fine in Firefox. Any suggestions on what I should try?

    [code=html]
    <a href="#" onClick="javasc ript:window.clo se();">close window</a>
    [/code]

    I've tried window.close(se lf) as well, but that's not working either
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You don't need the "javascript :" part. window.close() should work. So does it just not work or can you see any errors too?

    Comment

    • dmorand
      New Member
      • Sep 2007
      • 219

      #3
      Originally posted by acoder
      You don't need the "javascript :" part. window.close() should work. So does it just not work or can you see any errors too?
      I removed the javascript part, but still nothing. It works in Firefox, just not IE. I'm not getting any errors in the statusbar.

      Comment

      • dmorand
        New Member
        • Sep 2007
        • 219

        #4
        Originally posted by dmorand
        I removed the javascript part, but still nothing. It works in Firefox, just not IE. I'm not getting any errors in the statusbar.
        Actually I take it back. It works in IE6, just not IE7.

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Can you produce a small version of your code that demonstrates the problem?

          Comment

          • dmorand
            New Member
            • Sep 2007
            • 219

            #6
            Originally posted by acoder
            Can you produce a small version of your code that demonstrates the problem?
            I think it has to do with the popup windows and how I'm opening them, not sure though.

            Here is some of the code:

            [code=html]
            ***** index.cfm code portion *****
            <cfif session.access eq 'admin'>
            <li><a href="##" onclick="popup( 'emulation.cfm' ,140,500,'emula tion');">Emulat ion</a></li>
            <li><a href="##" onclick="alert( 'Under Development');" >Administration </a></li>
            </cfif>

            ***** emulation.cfm code portion *****
            <a href="#" onclick="window .close();">clos e window</a>

            ***** javascript popup function *****
            function popup(url,heigh t,width,mywindo w,scrollbars){
            params="height= " + height + ",width=" + width + ",scrollbar s=" + scrollbars + ",status=1" ;
            window.open(url ,mywindow,param s);
            }
            [/code]

            Comment

            • dmorand
              New Member
              • Sep 2007
              • 219

              #7
              It might be the system I'm testing on. I just opened the page on another computer, and all of the popup windows close with no problem.....hmm mmm

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                Check your browser settings then.

                Comment

                Working...