有没有办法在没有用户交互的情况下在iBooks中运行javascript? [英] Is there any way to run javascript in iBooks without user interaction?

查看:117
本文介绍了有没有办法在没有用户交互的情况下在iBooks中运行javascript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们一直在iBooks 3中测试HTML小部件,并且在线连接方面取得了一些成功。但缺点之一是它需要用户交互来实际扩展小部件并运行Javascript。有没有办法在iBook的后台运行Javascript,而不需要在常规分页之外进行用户交互?

We've been testing HTML widgets in iBooks 3 and had some success in connecting online. One of the drawbacks, though, is it requires user interaction to actually expand the widget and run Javascript. Is there a way to run Javascript in the background of the iBook, without requiring user interaction outside of regular paging?

例如,如果我们想让Mixpanel运行在背景,我们怎么做?是否有其他类型的小部件允许这种情况发生?或者除了HTML小部件之外还有其他运行javascript的东西吗?

For example, if we wanted to have Mixpanel running in the background, how would we do that? Is there another type of widget that allows this to happen? Or is there something else that runs javascript besides the HTML widget?

编辑:为了澄清,我正在使用iBooks Author来创建完整的书,其功能是在其中添加HTML小部件。

edit: To clarify, I'm using iBooks Author to create the full book, which has the functionality to add HTML widgets inside it.

推荐答案

ibooks中的小部件在用户激活之前不会执行JS。因此,即使小部件的链接可能在您的书中可见,但它无法通过ajax进行连接或在启动之前执行任何其他操作。启动后,窗口小部件也无法访问图书内容。如果你想在一个小部件中运行mixpanel你可以,但除非你的小部件还包含书的所有内容(和阅读系统),否则没有意义。

Widgets in ibooks do not execute JS until they are activated by the user. So even though the link for the widget may be visible in your book, it's not capable of making connections via ajax or doing anything else until launched. Once launched, the widget has no access to the book content either. If you wanted to run mixpanel in a widget you could, but it wouldn't make sense unless your widget also contained all the content of the book (and a reading system).

这篇关于有没有办法在没有用户交互的情况下在iBooks中运行javascript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆