为什么@contenteditable不能在iPhone上运行?

[英]Why doesn't @contenteditable work on the iPhone?


Safari HTML Reference: Supported Attributes says:

Safari HTML参考:支持的属性说:

contenteditable

CONTENTEDITABLE

If true, the element can be edited on the fly; if false, it cannot.

如果为true,则可以动态编辑元素;如果错误,则不能。

Availability

可用性

Available in Safari 1.2 and later. Available in iPhone OS 1.0 and later.

适用于Safari 1.2及更高版本。适用于iPhone OS 1.0及更高版本。

However, on my iPhone, I can't get it to work. Anyone have success with this?

但是,在我的iPhone上,我无法让它工作。任何人都有这个成功吗?

You can try it with this document (admittedly not pure html, but that document works in desktop Safari, and Chrome and Firefox 3). I haven't been able to get even the simplest html document to be editable in mobile Safari.

您可以尝试使用此文档(诚然,这不是纯HTML,但该文档适用于桌面Safari,Chrome和Firefox 3)。我甚至无法在移动Safari中编辑最简单的html文档。

5 个解决方案

#1


7  

contenteditable has been added to iOS 5 beta 2, according to one of the developer videos from WWDC 2011. I suggest signing up to Apple's Safari developer program and downloading that video from the WWDC videos page.

根据WWDC 2011的一个开发者视频,iOS 5 beta 2已经添加了contenteditable。我建议注册Apple的Safari开发者计划并从WWDC视频页面下载该视频。

If you sign up to be a Safari dev, you also gain the privilege to submit your Website to their online iOS Web app gallery.

如果您注册成为Safari开发者,您还有权将您的网站提交到他们的在线iOS Web应用程序库。

Edit: I've confirmed this works on my iPad running iOS 5.0.1. Try it out here: http://www.quirksmode.org/dom/execCommand/

编辑:我已经确认这可以在运行iOS 5.0.1的iPad上运行。在这里试试:http://www.quirksmode.org/dom/execCommand/

#2


2  

It works, kind of. I thought contenteditable doesn't work on iPhone before. When I set a div to contenteditable I couldn't move the cursor/pointer to where I wanted to move it. But, when I was fiddling around XHTML with contentEditable within iBooks.app on iPad, I found that "execCommand('insertText', null, 'foobar');" worked within Mobile Safari.

它有效,有点。我认为contenteditable之前在iPhone上不起作用。当我将div设置为contenteditable时,我无法将光标/指针移动到我想移动它的位置。但是,当我在iPad上的iBooks.app中使用contentEditable摆弄XHTML时,我发现“execCommand('insertText',null,'foobar');”在Mobile Safari中工作。

#3


1  

If you wanted to, you could make a virtual keyboard using clever css and javascript, and make it into a bookmarklet.

如果你愿意,你可以使用聪明的CSS和javascript制作虚拟键盘,并将其制作成书签。

#4


0  

The design mode and content editable are working fine in IOS 5.But in previous versions it is not working.There is post

IOS 5中的设计模式和内容可编辑工作正常。但在以前的版本中,它不起作用。有帖子

http://mobile.tutsplus.com/tutorials/mobile-web-apps/safari-5_html5/

http://mobile.tutsplus.com/tutorials/mobile-web-apps/safari-5_html5/

#5


-3  

I think this is because editing HTML requires quite an advanced user interface. That's why desktop Safari implements it, while Mobile Safari doesn't.

我认为这是因为编辑HTML需要相当高级的用户界面。这就是桌面Safari实现它的原因,而Mobile Safari却没有。

智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2009/04/06/3d6540f7d9b60d2b789b2812c00447da.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告