Board Thread:Support Requests - Getting Technical/@comment-2112998-20130125015527/@comment-5209426-20130125170812

The Visual Editor is not a textbox, it's an IFrame in Designer Mode. Or more simply, the Visual Editor is a web-page you build by typing plain text which your web browser translates into raw HTML code. [Wikia's editor then translates the HTML code into wikitext after it's sent to the server]

You can probably guess the problem. You need to manipulate the DOM to insert text, finding the cursor location is difficult as Design Mode IFrames are not properly standardized, I think it varies quite badly across different browsers so whatever you try doing may end up working in Chrome but not Firefox or IE, or work in IE but not Firefox or Chrome.

In all likelihood, whatever you're doing is going to have to be limited to source mode unless you're willing to invest a lot of time and research into this. Here's some docs I found that may help you if you want to pursue this.