使用 Opera Mobile 10 扫描输入
我们为一款 PDA 应用程序选择了 Opera Mobile,一切都很顺利,直到我们在将扫描输入输入到其中一个文本字段时遇到了问题。
解决此问题的一般方法是在执行扫描操作时将一个文本框设置为具有焦点。
不幸的是,Opera 有意无意地不支持这一点。当您进入屏幕时,焦点不存在,并且无法明确设置它。接下来最糟糕的是,您也无法检测到按键事件,这使得几乎不可能从扫描操作中获取输入事件。
我不知道为什么 Opera 这个最受好评的移动浏览器不支持这个。
这些地方一遍又一遍地问同样的问题,
http://dev.opera。 com/forums/topic/255066
http://dev.opera.com/forums/topic/650332
http://dev.opera.com/forums/topic/384311
我们也在 Opera Dev 论坛上发帖,似乎他们(到目前为止)没有解决这个问题。如果有人尝试过解决方法,我们将有兴趣听到解决方案。
请注意,此处中的解决方案在 Opera Mobile 中不起作用10.我没有在建议的9.X版本中尝试过。
We have chosen the Opera Mobile for one PDA application, everything went well until we hit a problem with regards to taking a scanned input to one of the text fields.
The general way you'd approach this problem is by setting one textBox to have focus when the scan operation is performed.
UNFORTUNATELY, intentionally or unintentionally Opera is not supporting this. The focus is no-where when you enter in to the screen and there is no way of explicitely setting it. Worst comes next, you cannot detect the key-press events too, which makes it virtually impossible to take the input event from the scan operation.
I have no clue why Opera, one of the best acclaimed mobile browsers, does not support this.
These are the places the same question is asked over and over again,
http://dev.opera.com/forums/topic/255066
http://dev.opera.com/forums/topic/650332
http://dev.opera.com/forums/topic/384311
We have posted in the Opera Dev forum as well and it seems that they (so far) have no solution for this. If anyone has tried a workaround, we would be interested to hear the solution.
And please note that the solution in here is not working in Opera Mobile 10. I have not tried it in the proposed 9.X version.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己找到的。下面是如何做到这一点。
在表单中有一个隐藏按钮
有一个 JavaScript 在隐藏按钮的点击事件上被触发。
使用文档末尾的 javascript 单击按钮
I found it myself. And here is how to do it.
Have a hidden button in the form
Have a javascript to get fired on the click event of the hidden button.
Have the button clicked using a javascript at the end of the document