Start New Discussion within our Web Development Community

Hi i want to close my popup window..
how to do it?
window.close() is not working..

i m showing my popup using jquery..
i want to close popup when close button is clicked..

Well if you are using jQuery might I reccomend using the dialog feature.

Setting it up is simple

1.) create a div in your html and a button so the dialog can be opened and closed :

//within html

<div id='my_first_dialog'>  <img src='dancing_homer.gif'/> </div> 
 <div id='diag_button'>  CLICK ME!!!!!! </div>

2.) You want to create an event listener so your browser knows to activate the event when the button is open

 var open = 'no' 
  $('#my_first_dialog').dialog(); // hides your div and gives it the dialog attributes 
  //add in a listener so it knows when  to open your dialog 

      if(open == 'no'){
         $('#my_first_dialog').dialog('open'); //opens your dialog
         open = 'yes'; 
         $('#my_first_dialog').dialog('close'); //closes your dialog


Now if you so choose you can get more technical, and add buttons to your dialog which could also do some action. But ill leave that up to you to look up.

you can find it here at :

Hope this helps! :)

That is if what your doing isnt an extra window.... to another webpage. In that case most of todays browsers put these into tabs and add the needed close and minmize buttons for the users to use anyway...


I m calling popup from combobox binding

$('#cbmAppIniId').bind('change', function(e) { 

                var value = $(this).val();

                if(value == 'ShortList')



i tried my best but pop up is not clossing..

This article has been dead for over six months. Start a new discussion instead.