为什么jQuery模态对话框会在开发模式下显示而不会出现在生产模式中? [英] Why would a jQuery Modal Dialog display in development mode and not appear in production mode?

查看:61
本文介绍了为什么jQuery模态对话框会在开发模式下显示而不会出现在生产模式中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自脚本标签



From script tag

$('input[id*=anyTrouble]').click(function () {
    alert('trouble has arrived');
    var con = $('#myTroubleNote').val();
    $("#troubleNote").val(con);
    $("#dialog-trouble").dialog("open");
    return false;
});




$("#dialog-trouble").dialog({
    title: "Trouble Information",
    autoOpen: false,
    height: 600,
    width: 1000,
    modal: true,
    dialogClass: "no-close",
    buttons: {
        "Okay": {
            class: 'okDialogButton',
            text: 'OK',
            click: function () {
                var bValid = true;
                var tType = $("#ddl_TType option:selected").val();
                var tModule = $("#ddl_Module option:selected").val();
                var thisNote = $('#troubleNote');
                var notelength = thisNote.val();

                bValid = bValid && checkLength(thisNote, "TroubleNote", 3, 2048);
                bValid = bValid && (notelength.length > 2);
                /* here is where you put the content of the note into the hidden variable.*/
                if (bValid) {
                    $('#myTroubleNote').val(thisNote.val());
                    $('#myTroubleNote').change();
                    $('#myType').val(tType);
                    $('#myType').change();
                    $('#myModule').val(tModule);
                    $('#myModule').change();
                    $(this).dialog("close");
                }
            }
        },
        Cancel: function () {
            $(this).dialog("close");
        }
    },
    close: function () {
        allFields.val("").removeClass("ui-state-error");
    }
});







来自身体标签



< asp:按钮ID =anyTroublename =anyTroublerunat =serverText =报告错误/请求CssClass = annbutton/>








From body tag

<asp:Button ID="anyTrouble" name="anyTrouble" runat="server" Text="Report Error/Request" CssClass="annbutton" />


<div id="dialog-trouble" style="display:none;" >
            <asp:Label ID="lbl_TType" runat="server" style="position:absolute; left: 40px; top: 5px; background-color:inherit; font-size:small; font-names:Cambria,small;" Visible="true" >Type of Problem/Request:</asp:Label>
            <asp:DropDownList ID="ddl_TType" runat="server" ClientIDMode="Static"

                style="position:absolute; left: 220px; top: 5px; background-color:inherit; font-size:small; font-names:Cambria,small; width: 265px;" visible="true">
            </asp:DropDownList>
            <asp:Label ID="lbl_Module" runat="server"

                style="position:absolute; left: 590px; top: 5px; background-color:inherit; font-size:small; width: 114px; font-names:Cambria,small; right: 444px;"

                Visible="true" >Module or Page :</asp:Label>
            <asp:DropDownList ID="ddl_Module" runat="server" ClientIDMode="Static"

                style="position:absolute; left: 710px; top: 5px; background-color:inherit; font-size:small; font-names:Cambria,small; width: 225px;" visible="true">
            </asp:DropDownList>
            <asp:TextBox ID="troubleNote" runat="server" BackColor="#F0F0F0" Visible="true" ClientIDMode="Static"

                BorderColor="#669999" BorderStyle="Solid" BorderWidth="2px"

                Font-Names="Cambria" Font-Size="Medium" ForeColor="Black" Rows="40"

                Wrap="true" Text="" style="position:absolute; top: 25px; left: 40px; height: 600px; width: 1000px;" TextMode="MultiLine">
            </asp:TextBox>
</div>

推荐答案

' input [id * = anyTrouble]' )。click(function(){
alert(' 麻烦已经到了');
var con =
('input[id*=anyTrouble]').click(function () { alert('trouble has arrived'); var con =


' #myTroubleNote')。val();
('#myTroubleNote').val();


#troubleNote)。val(con);
("#troubleNote").val(con);


这篇关于为什么jQuery模态对话框会在开发模式下显示而不会出现在生产模式中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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