Topic: Uncaught TypeError: Cannot call method 'apply' of undefined
Hi guys, when I try to save the content of the textarea I get this error in Google Chrome (Uncaught TypeError: Cannot call method 'apply' of undefined) and this in Mozilla Firefox with Firebug extension (f is undefined "return f.apply(s || t, Array.prototype.slice.call(arguments, 1));" )
This is an app built using Spring MVC architecture, with JSP pages as user frontend.
The textbox to be transformed into the editor is defined in a .jsp as following (this is the complete JSP):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<body>
<div id="initScriptEditor"></div>
<div>
<form id="tabEditorForm">
<textarea id="editorId" name="content" cols="150" rows="30">
</textarea>
</form>
</div>
</body>
</html>
I initiated the editor in a .js file loaded dynamically with Ajax, as following:
tinyMCE
.init(
{
language : "it",
mode : "exact",
elements : "editorId",
theme : "advanced",
plugins : "emotions,spellchecker,advhr,insertdatetime,preview, print, table, template,save",
save_onsavecallback : "postEditor('/DeliDete/saveEditor','','tabEditorForm','initScriptEditor')",
// Theme options - button# indicated the row# only
theme_advanced_buttons1 : "newdocument,|,cut,copy,paste,|,undo,redo,|,bullist,numlist,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,fontselect,fontsizeselect,formatselect",
theme_advanced_buttons2 : "outdent,indent,|,image,|,preview,|,forecolor,backcolor,|,insertdate,inserttime,|,advhr,,removeformat,|,sub,sup,|,charmap,print,|,template,|,save,cancel",
theme_advanced_buttons3 : "tablecontrols,table,row_props,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,split_cells,merge_cells",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_resizing : true
});
In the same file I have defined the callback function to be called, defined as following:
function postEditor(url, parameters, formName, initScript)
{
......
}
Is there anything I am doing wrong?
Thanks for your help!