Board Thread:Support Requests - Getting Technical/@comment-917693-20131211163939/@comment-11733175-20131212013810

Just to say, visual editor doesn't load in the same way the source or CK editor loads, it loads on the same page without reloading the page.

If you want your code to run in the VE, you can try this: mw.hook( 've.activationComplete' ).add( function {    // do with visual editor here } ); To address your question, your code should probably be split into separate functions, like this: $(function {

function converter { var converticon = " Convert "; $('.cke_button.RTEImageButton.cke_button_big').append(converticon); }

CKEDITOR.on("instanceReady", function {        if (window.WikiaEditor.getInstance('wpTextbox1').ck.document) { // ckeditor            RTE.getInstance.on("wysiwygModeReady", converter);        } else { // source editor            converter;        }    }); });