Tinymce Plugin throw an error “TypeError:undefined is not an object” in safari browser

Vote:
 

I have created tinymce accordion plugin and it is working fine in other browsers.But it throw an error of "TypeError:undefined is not an object " when insert and onclick.

It basically adding content and push them in to the editor as an accordion.

When i using safari in macbook air and when adding to the content to the editor it show this error in console and not adding them to the editor.

Here is the js code inside HTML file

 

Here is the Js code

var cfHtmlSnippetDialog = {   
    init: function () {  
        //empty function
}, insert: function () {
    var sel_text = 0;
    var ed = tinyMCEPopup.editor;
    if (ed.selection.getContent()) {
        content = ed.selection.getContent();
        sel_text = 1;
    } else {
        content = ed.getContent();
    }
    if (edit) {
        tinyMCEPopup.editor.dom.select('#' + accordionID)[0].innerHTML = jQuery('#' + accordionID).html();
        tinyMCEPopup.execCommand('mceInsertContent', false, "");
        tinyMCE.triggerSave();
    } else {
        tinyMCEPopup.execCommand('mceInsertContent', false, "
" + jQuery('.accordion-panel-group').html() + "
"); } tinyMCE.triggerSave(); tinyMCEPopup.close(); } }; tinyMCEPopup.onInit.add(cfHtmlSnippetDialog.init, cfHtmlSnippetDialog);

 

I can insert first accordion text to the editor.But after second text it throw this issue in console and pointing out this position

tinyMCEPopup.editor.dom.select('#' + accordionID)[0].innerHTML = jQuery('#' + accordionID).html();
#132992
Aug 24, 2015 8:14
Vote:
 

Hi,

You should check which part of the chain returns "undefined". Try to use "watch window" or split this line into several assignments. It could be 


tinyMCEPopup.editor.dom.select('#' + accordionID)

or

tinyMCEPopup.editor.dom

or 

tinyMCEPopup.editor

#133013
Edited, Aug 24, 2015 22:38
Vote:
 

I'm working eith microsoft 8.1 environment and when i check that part it is fine.Working well.But issue is when i host the site and logged using mac book safari browser it throws the error in the console.

I Tested with other environment and other browsers.Also Safari installed with windows and tested.It worked fiine.Only not properly working when i use safari browser in mac book .

#133381
Edited, Sep 03, 2015 10:48
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.