Last Updated: 09 Jul 2018 12:45 by ADMIN
Marin Bratanov
Created on: 30 May 2018 09:04
Category: Ajax
Type: Bug Report
jQuery button click in RadAjaxPanel under FireFox in R2 2018 causes TypeError: access to strict mode caller function is censored
Using a hidden button and calling its .click() method is sometimes used to invoke a postback under some application logic conditions. If you use the jQuery method and a RadAjaxPanel, this will no longer work with jQuery3 because its strict mode causes the MS AJAX scripts to throw an error.

Below is a sample repro of the scenario and it shows two of the workarounds. The third workaround is to downgrade jQuery to an older version (for example, 1.11.1 which is the previous version the suite used):

        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        <telerik:RadCodeBlock runat="server" ID="rcb1">
                function clickHiddenButton1() {
                    //workaround 1
                    //__doPostBack("<%=Button1.UniqueID%>", "");
                    //workaround 2
        <asp:Button Text="click hidden button" ID="testButton1" OnClientClick="clickHiddenButton1(); return false;" runat="server" />
        <telerik:RadAjaxPanel runat="server" ID="rap1" OnAjaxRequest="rap1_AjaxRequest">
            <asp:Label Text="" ID="Label1" runat="server" />
            <asp:Button Style="display: none;" Text="hidden button" ID="Button1" OnClick="Button1_Click" runat="server" />