JQuery对话框没有第二次打开 [英] JQuery dialog not opening second time

查看:86
本文介绍了JQuery对话框没有第二次打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我打开jquery对话框的代码。它第一次工作,但不是第二次:(帮助请





  function  LoadGridView(id,row){
var dlg = jQuery(' #Main_ProductEdit')。load(' ProductEdit.aspx');

dlg.dialog({autoOpen: false ,modal: true ,显示:' slide',关闭:' slide',width: 400 ,height: 160
按钮:{ 取消 function (){dlg.dialog( close);}}
});
alert(' opening');
dlg.dialog( open);


}

解决方案

从我所看到的,似乎是JQuery'load'和'dialog'函数之间的某种冲突。每次调用此函数时,您是否真的需要将对话框添加到元素中?



以下内容适用于我的浏览器。



Javascript:

< pre lang =Javascript> // 此var必须是全局的
var dlg;


document )。ready( function (){

// 抓住元素
dlg =


[id

hi, this is my code to open a jquery dialog. it works first time but not second time :( help pls


function LoadGridView(id, row) {
          var dlg = jQuery('#Main_ProductEdit').load('ProductEdit.aspx');

          dlg.dialog({ autoOpen: false, modal: true, show: 'slide', close: 'slide', width: 400, height: 160,
              buttons: { "cancel": function () { dlg.dialog("close");} }
          });
          alert('opening');
          dlg.dialog("open");


      }

解决方案

From what I can see, there seems to be some sort of a conflict between the JQuery 'load' and the 'dialog' functions. Do you really need to be adding the dialog to the element every time this function is called?

The following works in my browser.

Javascript:

// this var needs to be global
var dlg;


(document).ready(function () { // grab the element dlg =


("[id


这篇关于JQuery对话框没有第二次打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆