Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100106
Ubuntu/9.10 (karmic) Firefox/3.5.7
Using Scott Storborg's fork of jwysiwyg [1], when loading a form
through $.ajax() the editor area cannot get focus. If I open the
"source" pane and type in there, once I then close the pane, the text
will appear inside the editor. However, I cannot do anything with the
text. It seems that all keydown events are ignored.
The script that is returned by the AJAX call is:
$(function() {$('#CommentBody').wysiwyg({
controls: {
// lots of key: val pairs ...
}
});
If I click on one of the buttons, I get the following error:
uncaught exception: [Exception... "Component returned failure code:
0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
http://mi_mtl.apollo/js/lib/jquery.wysiwyg.storborg.js :: anonymous ::
line 595" data: no]
anonymous(form#CommentAddForm add, "handle", Object
name=data)jquery-1.4.1.js (line 1020)
anonymous(form#CommentAddForm add, "submit", function(), Object
name=data)jquery-1.4.1.js (line 1572)
anonymous()jquery-1.4.1.js (line 2331)
anonymous([form#CommentAddForm add selector=form context=document],
function(), Object name=args)jquery-1.4.1.js (line 572)
anonymous(function(), Object name=args)jquery-1.4.1.js (line 240)
anonymous("submit", Object name=data, function())jquery-1.4.1.js (line 2330)
anonymous(function())jquery-1.4.1.js (line 2495)
anonymous(textarea#CommentBody, Object)jquery.w...orborg.js (line 428)
Wysiwyg(textarea#CommentBody, Object)jquery.w...orborg.js (line 110)
Wysiwyg(textarea#CommentBody, Object)jquery.w...orborg.js (line 111)
anonymous()jquery.w...orborg.js (line 103)
anonymous([textarea#CommentBody length=1 0=textarea#CommentBody
context=document], function(), Object name=args)jquery-1.4.1.js (line
572)
anonymous(function(), Object name=args)jquery-1.4.1.js (line 240)
anonymous(Object)jquery.w...orborg.js (line 101)
anonymous()language:en (line 41)
anonymous(function())jquery-1.4.1.js (line 250)
anonymous(function(), Object name=context)jquery-1.4.1.js (line 160)
anonymous(function(), Object name=context)
If I add some text through the source pane, select it, and then click
the bold button, I get this:
uncaught exception: [Exception... "Component returned failure code:
0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
http://mi_mtl.apollo/js/lib/jquery.wysiwyg.storborg.js :: anonymous ::
line 595" data: no]
anonymous(html, "handle", Object name=data)jquery-1.4.1.js (line 1020)
anonymous(Object type=focus timeStamp=1264904061090, [Object
type=focus timeStamp=1264904061090 0=Object], html)jquery-1.4.1.js
(line 1805)
anonymous(Object type=focus timeStamp=1264904061090, [Object
type=focus timeStamp=1264904061090 0=Object], body)jquery-1.4.1.js
(line 1824)
anonymous()jquery-1.4.1.js (line 2352)
anonymous([body 0=body context=body length=1 jquery=1.4.1],
function(), Object name=args)jquery-1.4.1.js (line 572)
anonymous(function(), Object name=args)jquery-1.4.1.js (line 240)
anonymous("focus", Object name=data)jquery-1.4.1.js (line 2351)
anonymous(Object name=fn)jquery-1.4.1.js (line 2495)
anonymous()jquery.w...orborg.js (line 491)
anonymous(Object originalEvent=Event focus type=focus)jquery-1.4.1.js
(line 1884)
anonymous()jquery-1.4.1.js (line 1579)
When I load the editor in a plain page (no AJAX) all is good. I
suspect this may be a jQuery bug with the way it runs script returned
by ajax(). Can anyone shed some light?
Starting in safe mode gave the same error. It works fine in Opera, btw.
No comments:
Post a Comment