jQueryUI对话框+ Firefox + ASP.Net =严格访问严格模式的调用者功能 [英] jQueryUI Dialog + Firefox + ASP.Net = access to strict mode caller function is censored

查看:56
本文介绍了jQueryUI对话框+ Firefox + ASP.Net =严格访问严格模式的调用者功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面可以在IE和Chrome中正常运行,但不能在Firefox和Opera中运行.当我说它不起作用时,我的意思是Submit按钮根本不执行任何操作.这是一个页面,上面有几个嵌套的UpdatePanels,上面还有几个jQueryUI手风琴.

I have a page that works great in IE and Chrome, but doesn't work in Firefox and Opera. When I say it doesn't work I mean that the Submit button doesn't do anything at all. It is a page with several nested UpdatePanels on it and a couple of jQueryUI Accordions on it too.

我有一个简单的div.

<div id="date-dialog" title="Date?">
    <label id="lblDate" for="txtDate">
        Please Enter Your The Date:
    </label>
    <input type="text" id="txtDate" class="text ui-widget-content ui-corner-all" />
</div>

然后我有一些简单的代码将其变成一个对话框:

And then I have some simple code to turn it into a dialog:

$('#date-dialog').dialog({
    autoOpen: false,
    modal: true,
    resizable: false,
    buttons: {
        "Submit": function () {
            __doPostBack('DateButton', $('#txtDate').val());
        },
        "Cancel": function () {
            $(this).dialog("close");
        }
    }
});

$('#txtDate').datepicker({ dateFormat: 'yy-mm-dd' });

我也尝试添加此操作,这无济于事,并且实际上不适用于模式对话框:

I've also tried adding this, which doesn't help and which actually doesn't work with a modal dialog:

    open: function (type, data) {
        $(this).parent().appendTo("form");
    },

在Firefox中,出现以下错误:

In Firefox I get the following error:

Error: TypeError: access to strict mode caller function is censored
Source File: http://ajax.microsoft.com/ajax/4.0/2/MicrosoftAjaxWebForms.debug.js
Line: 718

我不知道该怎么办才能解决此问题.我很想关闭strict mode,但是找不到有关如何执行此操作的任何信息.使用Google,我几乎找不到有关该错误的任何信息.看来我正在做的事情应该很简单.

I have no idea what to do to fix this. I would love to turn off strict mode, but I can't find any information on how to do that. I can barely find any information about that error using Google. It seems like what I'm doing should be quite simple.

推荐答案

虽然这实际上并未解释如何解决该问题,但这是一种可行的解决方法.

While this doesn't actually explain how to fix the problem, this is a working work-around.

我创建了一个与对话框中的每个字段相对应的隐藏字段.然后,我创建了一个按钮.这些必须保留在对话框div之外,因为div上交到对话框时会移到窗体的外部.然后,我将对话框创建代码修改为如下所示:

I created a hidden field that corresponded to each field in the dialog box. Then I created a button. These had to be kept outside of the dialog box div because the div is moved to outside the form when it is turned in to a dialog box. Then I modified my dialog box creation code to be something like this:

$('#date-dialog').dialog({
    autoOpen: false,
    modal: true,
    resizable: false,
    buttons: {
        "Submit": function () {
            $('#<%=hfDate.ClientID %>').val($('#txtDate').val());
            $('#<%=btnFormSubmit.ClientID %>').click();
            $(this).dialog("close");
        },
        "Cancel": function () {
            $(this).dialog("close");
        }
    }
});

这篇关于jQueryUI对话框+ Firefox + ASP.Net =严格访问严格模式的调用者功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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