More in this section

Forums / Bugs & Issues / Javascript error after 4.3 upgrade

Javascript error after 4.3 upgrade

4 posts, 1 answered
  1. Kevin
    Kevin avatar
    19 posts
    Registered:
    30 Sep 2010
    14 Dec 2011
    Link to this post
    After upgrading to 4.3, every page on the frontend site throws a JavaScript error:

    Error: Telerik.Web.UI.Editor is undefined
    Source File: http://localhost:60876/ScriptResource.axd?d=M8AhUPxmZzmgjfFKFE8fZ0pd-hH9SgQIkITxtoniKOd60u2zZWKCFj-QkdQW47pwDHSSO2gtAuioZn_wxGZdjFeWwg__tiYazcKB-SKTigOXJ0BXjaZeaf1QQjW1VYeMHTpTlxr7lha7gD26dUmI3o8pgDRbSsWTyItApX-dw6eLz4Ikxm7h4ijTp1Zn5VBd0&t=2fb7c1d1
    Line: 522

    Also see the attached screenshot of how it looks when debugging in Visual Studio.

    Thanks,
    Kevin
  2. Steve
    Steve avatar
    16 posts
    Registered:
    14 Jul 2010
    14 Dec 2011
    Link to this post
    Same issue here.. the offending code shown below..

    jQuery(document).ready(function() {//fix align commands in RadEditor; remove when upgrading to Q3.2011
        jQuery.extend(Telerik.Web.UI.Editor.Utils, {
    ScriptResource.axd:522 Uncaught TypeError: Cannot read property 'Utils' of undefined
            execDocumentCommand: function (doc, commandName, value)
            {
                var tempElement, tempText;
                if (!doc || !commandName)
                    return false;
                     
                try
                {
                    if(commandName == "JustifyNone" && !$telerik.isIE)
                        return this.applyCustomJustifyNone(doc);
                    else if ($telerik.isFirefox && this.isAlignCommand(commandName))
                        return this.firefoxCustomAlign(doc, commandName);
                    else
                        return doc.execCommand(commandName, false, value);
                }
                catch (ex)
                {
                    var selection = new Telerik.Web.UI.Editor.Selection(doc.defaultView || window);
                    var selElem = selection.getParentElement();
                    tempElement = document.createElement("br");
                    selElem.insertBefore(tempElement, selElem.firstChild);
                    var result = doc.execCommand(commandName, false, value);
                    return result;
                }
                finally
                {
                    if(tempText)
  3. Steve
    Steve avatar
    16 posts
    Registered:
    14 Jul 2010
    15 Dec 2011
    Link to this post
    I isolated it to the HtmlField control inside a listi tem template that was used on that page.  If you remove the HtmlField, which in my case was just setting the Text property from an Eval(), and replace it with a simple Eval() then it doesn't load that ajax resource.  This might have some side effects depending on what content is being evaluated, as I believe some controls may perform specialized markup to the content, but its worth a try if you are stuck before Telerik has a patch.

    Good Luck,
    Steve
    Answered
  4. Kevin
    Kevin avatar
    19 posts
    Registered:
    30 Sep 2010
    15 Dec 2011
    Link to this post
    Thanks Steve! That did the trick.
4 posts, 1 answered