Acess to strict mode caller function is censored

6 posts, 1 answers
  1. Martin
    Martin avatar
    41 posts
    Member since:
    Sep 2013

    Posted 16 Apr 2014 Link to this post

    Hi

    I have a javascript function on a page which uses Google Geocoder to get lat/lng for a a given address(postcode)

    After the lat/lng succeeds I want to call a Radjaxmanager request to do processing on server side.

    ie. RadAjaxManager.ajaxRequest("DO SOMETHING!");

    Calling the above code produces the following error
    TypeError: access to strict mode caller function is censored
    ( IN Telerik.Web.UI.WebResource.axd )

    Any help really appreciated :}

    Full code below...

    Regards

    Martin

    ================================================================
    function GetLatLng(address) {

        var geocoder = new google.maps.Geocoder();
        geocoder.geocode({ 'address': address + ", UK", region: "UK" }, function (results, status) {

            var latitude = 0;
            var longitude = 0;
            if (status == google.maps.GeocoderStatus.OK) {
                latitude = results[0].geometry.location.lat();
                longitude = results[0].geometry.location.lng();
            } else {
                // Postcode/Address NOT found!
            }

            alert("START REQUEST");

            RadAjaxManager.ajaxRequest("DO SOMETHING!");

            alert("END REQUEST");

        });

    }
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 18 Apr 2014 Link to this post

    Hi Martin,

    I tried to reproduce the problem but to no avail. Could you please provide more detailed information on the specific scenario?
    • Which version of RadControls for ASP.NET AJAX and .NET Framework are used in the application?
    • Under which browser and its version the problem occurs?
    • Are you able to reproduce the problem on the live demos? If so, could you please provide the exact steps the need to be executed in order to reproduce the issue?
    • Could you please provide a simple fully runnable project reproducing the problem so we can investigate it further?

    For your convenience I have attached my test page, could you please modify it to a point where the problem occurs and send it back?

    Regards,
    Dobromir
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Martin
    Martin avatar
    41 posts
    Member since:
    Sep 2013

    Posted 21 Apr 2014 in reply to Dobromir Link to this post

    Hi Dobromir

    Thanks and sorry for my delayed response....

    1) Version RadControls (Telerik.Web.UI.dll) 2013.3.1114.40
    (This is for a Sitefinity project - so it's fixed at version 6.2.49110)

    2) Browsers tested - Firefox 28.0 and Internet Explorer 11.0.9600

    3) I've created a simple test page which can be run via: http://sandbox.sprayedsplashbacks.co.uk/test/test1.aspx
    (Also your test page is at http://sandbox.sprayedsplashbacks.co.uk/test/default.aspx)

    4) Was going to send you a simple project in a ZIP file
    But wouldn't allow me  to attach project ZIP file


    Regards

    Martin
  4. Martin
    Martin avatar
    41 posts
    Member since:
    Sep 2013

    Posted 21 Apr 2014 in reply to Dobromir Link to this post

    Hi Dobromir

    Quick update:

    I've downloaded Radcontrols 2014.1.403 (Sitefinity 7.0)
    and still get the error
    "Accessing the 'caller' property of a function or arguments object is not allowed in strict mode"

    This occurs when calling AjaxManager.Request inside the GeoCoder result function

    geocoder.geocode({ 'address': address + ", UK", region: "UK" }, function (results, status) {
       $find("ajaxMngr").ajaxRequest("DO SOMETHING!");
    }

    Regards

    Martin


  5. Answer
    Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 21 Apr 2014 Link to this post

    Hi Martin,

    It seems that Google Maps API is using Strict Mode and apparently MSAjax is not compatible with it - the error thrown originates from the __doPostBack() function.

    A possible workaround would be to wrap the ajaxRequest() call in a setTimeout, however, this will move the the execution outside of the current scope and might not work for this scenario but I was unable to find another approach to overcome the strict mode. 

    Regards,
    Dobromir
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Martin
    Martin avatar
    41 posts
    Member since:
    Sep 2013

    Posted 21 Apr 2014 in reply to Dobromir Link to this post

    Hi Dobromir

    Thanks and Yes, that pretty much confirms what I'm seeing....

    In my scenario, someone changes a postcode and I use Geocoder to get new lat/lng
    This then does a server side calculation which uses the AjaxManager

    Anyway I'll just have to think this one through (ie. Timeout:

    1) Update the lat/lng with Geocoder
    2) Then do the recalculation LATER :}

    Many thanks anyway for looking into the problem :}

    Regards

    Martin

Back to Top