This project has moved and is read-only. For the latest updates, please go here.
4
Vote

this.pasteHTML() returning 'r.select is not a function' error in firefox

description

line 123 of jHTMLArea-0.7.0.js is causes an error in firefox.
 
commenting out this line seems to fix this issue.

comments

aslh wrote Mar 16, 2011 at 5:50 PM

Since it only throws and error in firefox you might prefer to handle the error instead of leaving out the line completely. I would suggest to replace it with the following code until a solution for firefox is found:

if (typeof r.select == 'function') {
r.select();
}

wrote Nov 27, 2012 at 3:14 PM

nverwer wrote Nov 27, 2012 at 3:16 PM

The problem is still present in jHTMLArea-0.7.5, and the firefox version of 2012-11-27 (don't know which version number, I have lost count).
The suggested fix works.

wrote Feb 22, 2013 at 1:58 AM

gmoricz wrote May 31, 2016 at 11:46 PM

in 0.8 this error appear in IE 11 too.

gmoricz wrote May 31, 2016 at 11:49 PM

Thats what I did:
            if (typeof r.select == 'function') {
                r.pasteHTML(html);
            }
            else
            {
                r.deleteContents();
                r.insertNode($(this.iframe[0].contentWindow.document.createElement("span")).append($((html.indexOf("<") != 0) ? "<span>" + html + "</span>" : html))[0]);
            }