Monday, March 13, 2017

[JQuery][Resolved] Uncaught TypeError: (intermediate value)(intermediate value)(intermediate value) is not a function

Error message

Uncaught TypeError: (intermediate value)(intermediate value)(intermediate value) is not a function
    at editor_plugin.js:74
(anonymous) @ editor_plugin.js:74

Sample code

var TinyMCE_examplePlugin = {
    init : function(ed, url) {
        // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceexample');
        ed.addCommand('mceexample', function() {
            ed.windowManager.open({
                file : url + '/dialog.htm',
                width : 320 + parseInt(ed.getLang('example.delta_width', 0)),
                height : 120 + parseInt(ed.getLang('example.delta_height', 0)),
                inline : 1
            }, {
                plugin_url : url, // Plugin absolute URL
                some_custom_arg : 'custom arg' // Custom argument
            });
        });
    },

    createControl : function(n, cm) {
        return null;
    }
}

(function() {
    // Load plugin specific language pack
    tinymce.PluginManager.requireLangPack('example');
    tinymce.create('tinymce.plugins.examplePlugin', TinyMCE_examplePlugin);
    // Register plugin
    tinymce.PluginManager.add('example', tinymce.plugins.examplePlugin);
})();

Problem and solution

Missing a semi colon on the function BEFORE the one it throws an error on. Related text was marked as yellow background:
var TinyMCE_examplePlugin = {
    init : function(ed, url) {
        // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceexample');
        ed.addCommand('mceexample', function() {
            ed.windowManager.open({
                file : url + '/dialog.htm',
                width : 320 + parseInt(ed.getLang('example.delta_width', 0)),
                height : 120 + parseInt(ed.getLang('example.delta_height', 0)),
                inline : 1
            }, {
                plugin_url : url, // Plugin absolute URL
                some_custom_arg : 'custom arg' // Custom argument
            });
        });
    },

    createControl : function(n, cm) {
        return null;
    }
};

(function() {
    // Load plugin specific language pack
    tinymce.PluginManager.requireLangPack('example');
    tinymce.create('tinymce.plugins.examplePlugin', TinyMCE_examplePlugin);
    // Register plugin
    tinymce.PluginManager.add('example', tinymce.plugins.examplePlugin);
})();

Reference link:

http://stackoverflow.com/questions/23370269/jquery-autosize-plugin-error-intermediate-value-is-not-a-function

No comments :

Post a Comment