1

jHTMLarea works in all the browsers, but in IE9, if the textbox requires a scrollbar, anything below the initial window won't highlight when the user goes to highlight it.

The code below is what I use to call the plugin.

       $(function() {
            $("#aboutTextEdit").htmlarea({
            toolbar: ["bold", "italic", "unorderedList", "|", "link", "unlink" ], 
                loaded: function(event) {               
                }
            });
        });
Kimberly Fox
  • 617
  • 6
  • 13
  • apparently this is an issue with the iframe that is used by the plugin. Still looking for an answer, but I've found lots of people with issues using iframes and trying to select outside of the initial visible area in IE9. – Kimberly Fox Nov 19 '12 at 17:08

2 Answers2

1

I had the same Problem with jHTMLarea 0.7.5. This Problem exists in other WYSIWYG-Editors too.

For fixing this you must edit your jhtmlarea.js File. Search for:

designMode=on

Then delete this term and insert

edit.body.contentEditable = true;

..at the end of the function. Make sure, that you setting contentEditable AFTER the inital-document is written like this:

[..]

initEditor:function(options)
{
    var edit=this.editor=this.iframe[0].contentWindow.document;
    edit.open();
    edit.write(this.textarea.val());
    edit.close();
    if(options.css)
    {
        var e=edit.createElement('link');
        e.rel='stylesheet';
        e.type='text/css';
        e.href=options.css;
        edit.getElementsByTagName('head')[0].appendChild(e);

    [..] 
    edit.body.contentEditable = true;

[..]

It seems to be a solution that runs on Firefox too, so you not need to make a Browser-switch. Take a look that you setting "contentEditable" to an HTML-Element like "body" or "div" and not directly to the "document"-Object.

Pl3tx235j
  • 13
  • 4
0

Figured it out!! Thanks to Warren Bullock

And using this stackOverflow question (once I figured out it was an iframe issue): Unable to select the text left in the Iframe beyond the visible area

the kicker is going into the jHTMLArea file and commenting out this line: edit.designMode = 'on';

which is on line 308. Works great in all browsers now!

Community
  • 1
  • 1
Kimberly Fox
  • 617
  • 6
  • 13