我对 Titanium 实在是太陌生了,所以即使找到正确的搜索词也是一件苦差事,但我需要设计一种将外部内容加载到移动应用程序中的方法原型。大量的随机探索已经产生了 createWebView()
方法的 url
配置属性,但是有一个转折(你不知道会有这样的吗?)。现在,我只需要提取特定的 DOM 节点(id
值为 content
的 div
)并仅显示该内容。
据我所知,Kitchen Sink 应用程序的“XHR 到文件系统”演示看起来是正确的方法,但我不想白费力气。谁能确认我是否走在正确的轨道上?
作为一个附带问题,我(诚然)还没有研究太多,那就是我是否可以将 jQuery 加载到我的 Titanium 应用程序中并使用它从其他所有内容中提取 #content
DOM。
我将不胜感激任何想法。
I could not be any more brand-spanking new to Titanium, so even finding the right search terms is a chore, but I need to prototype a means of loading external content into a mobile app. Lots of random poking around has yielded the url
configuration property of the createWebView()
method, but there's a twist (didn't you know there would be?). Now I need to extract only a particular DOM node (the div
with an id
value of content
) and display only that content.
As best I can tell, it looks like the Kitchen Sink app's "XHR to Filesystem" demo looks like the right way to go, but I don't want to spin my wheels. Can anyone confirm whether I'm on the right track?
As a side question that I (admittedly) haven't researched much yet is whether I can load jQuery into my Titanium app and use it to extract the #content
DOM from everything else.
I'd appreciate any thoughts.
发布评论
评论(1)
您使用 httpClient 的方式是正确的,您还可以加载 jQuery,但我认为如果您只是尝试从 XML
http://wiki.appcelerator.org/display/guides/Working+with+Remote+Data
you are on the right track with using the httpClient, you can also load up jQuery, but i think that it might be overkill if you are just trying to pull some content from XML
http://wiki.appcelerator.org/display/guides/Working+with+Remote+Data