execCommand not working for xml file

Posted by ganapati on Stack Overflow See other posts from Stack Overflow or by ganapati
Published on 2010-05-04T07:40:34Z Indexed on 2010/05/04 7:48 UTC
Read the original article Hit count: 384

Filed under:
|
|
|

I am using execCommand command to 'Hilite' selected text on the page which is rendered with gecko engine/gtkmozembed.

if ( !document.execCommand("HiliteColor", false, colour) ) {
                document.execCommand("BackColor", false, colour);
}

This is working fine with HTML pages. But i have some XML pages( books in xml format). execCommand is not working for those XML pages. It gives warning like

TypeError: document.execCommand is not a function      

How can i make execCommand works on XML? Thanks.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about mozilla