Question

I have webview with contenteditable and use javascript to do rich text editing. It works with some commands like "Bold" and "Italic" below:

[webview stringByEvaluatingJavaScriptFromString:@"document.execCommand('Bold')"];

[webview stringByEvaluatingJavaScriptFromString:@"document.execCommand('Italic')"];

But somehow "superscript" and"subscript" below, it doesn't work:

[webview stringByEvaluatingJavaScriptFromString:@"document.execCommand('superscript')"];

[webview stringByEvaluatingJavaScriptFromString:@"document.execCommand('subscript')"];

Anyone knows, under iOS, do we have similar Rich-Text Editing in Mozilla, so that I can know what commands will work under Safari-UIWebview?

Était-ce utile?

La solution

Just tested this page on my iOS7.1 iPad:

http://quirksmode.org/dom/execCommand/

Both superscript and subscript work. Looking at the source, the following command is performed: document.execCommand("superscript", false, null);

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top