문제

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?

도움이 되었습니까?

해결책

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);

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top