| inserting a special char ¶ | |
| well. my problem is that i created a new function for this, it works great on windows firefox and ie, but firefox from linux has a little bug and i cant find out how to solve this, if i start inserting characters, i cant delete them, unless a press any key, am i doing something wrong? this is the function that im using.. HTMLArea.prototype.insertChar = function(car) { var sel = this._getSelection(); var range = this._createRange(sel); if (HTMLArea.is_ie) { range.pasteHTML(car); } else { var range2 = range.cloneRange(); var innerHTML = this.getHTML(); alert(innerHTML); //Fix for Firefox 1.5 . if(innerHTML == " "){ sel = this._getSelection(); sel.removeAllRanges(); range = this._createRange(); range.selectNodeContents(this._doc.body); sel.addRange(range); } var div = this._doc.createTextNode(entityDecode(car)); // Insert text at cursor position sel.removeAllRanges(); range.deleteContents(); range.insertNode(div); // Move the cursor to the end of text range2.selectNode(div); range2.collapse(false); sel.removeAllRanges(); sel.addRange(range2); } }; its weird cause it works in firefox for windows, it deletes everything correctly, but in linux it acts a little different :S hope some can point me out what im doing wrong, thnxs in advance. | |
| Re: inserting a special char ¶ | |
| function entityDecode(s) { //Agrega un caracter especial en el textarea. // construct a new document fragment with the given HTML | |
| last |
| Re[2]: inserting a special char ¶ | |
| what i believe is happening is that firefox "thinks" the htmlarea is empty, thats why i cant delete the characters that i insert..... is there a way to create an event like keydown..? so firefox thinks that someone pressed a key and inserted a character... | |
| last |














