2014-10-22 54 views
0

正常工作,我有一个JavaScript函数:模态对话框窗口无法在Chrome

$(document).ready(function() { 
    dialog = $("#dialog-form-sending" 
     ).dialog({ 
      autoOpen: false, 
      height: 600, 
      width: 900, 
      modal: true, 
      buttons: { 
       "send": sendMessage, 
      }, 
     }); 
dialog1 = $("#dialog-form-manager").dialog({ 
      autoOpen: false, 
      height: 600, 
      width: 900, 
      dialogClass: 'no-close success-dialog', 
      modal: true, 
     }); 
}) 

底部的HTML代码是我的对话窗口

<div id="dialog-form-sending" title="sendig message"> 
    <div class="Logo"> 
<img class="image" src="myimage" /> 
     <h2>message sending</h2> 
</div> 
</div> 


<div id="dialog-form-manager" title="suggest manager"> 
    <div class="Logo"> 
     <img class="image" src="myimage" /> 
     <h2>suggest manager</h2> 
    </div> 
</div> 

体JavaScript函数用于配置2模态窗口一个MVC4剃须刀page.in铬浏览器和其他浏览器在我的电脑上(由vs2012开发)此功能正常工作,但是当我释放它在服务器和调试模式下配置文件设置为false,Chrome停止正常工作,模式窗口部分出现在页面上(其他borwsers正常工作)。

什么问题?

+0

尝试将var放在对话变量之前,再放在dialog1变量之前。另请提供更多代码,以便更容易地发现问题。 – LiamWilson94 2014-10-22 09:38:23

+0

你有没有看过Chrome控制台?是否有任何错误陈述? – Chrisissorry 2014-10-22 09:44:43

+0

hi.my问题是在调试模式。其中调试模式是真正chorme正常work.but调试模式设置为false无效工作 – 2014-10-22 09:53:50

回答

0

您在对象定义的末尾有额外的, s。删除它们。

$(document).ready(function() { 
    dialog = $("#dialog-form-sending").dialog({ 
    autoOpen: false, 
    height: 600, 
    width: 900, 
    modal: true, 
    buttons: { 
     "send": sendMessage      // Remove here 
    }           // Remove here 
    }); 
    dialog1 = $("#dialog-form-manager").dialog({ 
    autoOpen: false, 
    height: 600, 
    width: 900, 
    dialogClass: 'no-close success-dialog', 
    modal: true         // Remove here 
    }); 
}) 
+0

我删除了额外的s,但问题仍然出现。在服务器上我将debug模式设置为true问题解决了。但是当debug模式设置为false时,出现问题 – 2014-10-22 11:53:22

相关问题