开发者

html gets wiped on dialog call

开发者 https://www.devze.com 2022-12-18 02:54 出处:网络
I am using $(selector).dialog(); to call atag in my html code.When I click on the link that sends me to this dialog, firebug (a firefox add on) shows that thetag gets erased!!The html code in the tag

I am using $(selector).dialog(); to call a tag in my html code. When I click on the link that sends me to this dialog, firebug (a firefox add on) shows that the tag gets erased!! The html code in the tag gets displayed fine the first time, bu开发者_JS百科t when the dialog box is closed by the default X in the upper corner, the dialog box won't reappear another time if I click on the link. This is the code that is inside of the click event.

$("#dialog").dialog({
 resizable: false,
 height:140,
 modal: true,
 autoOpen: true,
 overlay: {
  backgroundColor: '#000',
  opacity: 0.5
 },
 buttons: {
  'Delete this item': function() {
   $.get("delete.php", { food: foodID } );
   pausecomp(1000);
   $.get("CategoryAdmin.php", { course: courseID },
   function(data){
    //alert("in updateDisplay() "+c);
    $("#"+courseID).html(data);
    operationStripe();
    editCue();
   });
   return false;
   $(this).dialog('close');
  },
  Cancel: function() {
   $(this).dialog('close');
  }
 }
});


on this 2 lines: ('Delete this item' button)

   return false;
   $(this).dialog('close');

the 2nd line cannot be executed because you did a return call.

try changing removing return false;

0

精彩评论

暂无评论...
验证码 换一张
取 消