Titanium Appcelerator 中基于 URL 的窗口
我有一些问题
- 如何在钛合金中使用基于 url 的窗口?
- 将 url 设置为“.js”文件是否会运行文件中的所有代码,还是仅打开窗口?
- 它如何知道确切的窗口?是否需要任何命名约定?
I have some questions
- How do you use url based windows in titanium?
- Does setting the url to a ".js" file run all the code in the file or does it just open the window?
- How does it come to know about the exact Window? Is there any naming convention required?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有命名约定,您只需使用路径。
window.url = windows/window1.js
另外,正如您猜对的那样,当窗口打开时,代码也会运行:-)来自 docs: "带有 Windows 指令的 JavaScript 文件的 URL,此窗口将创建一个新的 JavaScript 子上下文,该子上下文将在其中运行。自己的线程和全局变量 空间。”
我认为这个子上下文信息将帮助您最了解他们。
No naming conventions and you just use the path.
window.url = windows/window1.js
Also the code run when the window is open as you correctly guessed :-)From docs: "url to a JavaScript file with the windows instructions. this window will create a new JavaScript sub-context that will run in its own thread and global variable space."
I think this sub-contexts info will help you understand them the most.