I have a problem with nicEdit link creation tool in IE and Firefox.
In general, I think the problem is related to the execCommand
in IE and FireFox. It seems document doesn't get updated after execCommand
executes.
This is an example of my problem with nicEdit create link command.
if(!this.ln) {
var tmp = 'javascript:nicTemp();';
this.ne.nicCommand("createlink",tmp);
this.ln = this.findElm('A','href',tmp);
// set the link text to the title or the url if there is no text selected
alert(this.ln);
if (this.ln.innerHTML == tmp) {
this.ln.innerHTML = this.inputs['title'].value || url;
};
}
The code above is called when no text is selected, Chrome returns 'javascript:nicTemp()'
for the alert(this.ln)
, while IE 8 and Firefox return 'undefined'
, so the next line after the alert
encounters an error in IE and Firefox.
it seems findElem
can't find the newly created link by nicCommand
which in turn calls execCommand
I had similar problems when I try to find and modify tags created with execCommand
, it seems the dom isn't updated to include them.
Am I right? How can I solve this problem? how can I force the document to be updated ....
please help