如何在Appcelerator Titanium Mobile Work中添加jquery?

是否可以将jquery集成到Titanium Appcelerator中并且它能正常工作吗? 否则我们无法将jquery集成到titanium金属加速器中?

任何人帮助我?

你究竟想做什么? 没有DOM,我不确定它是否能正常工作

你可以在WebView中使用你想要的任何JS库。 在WebView之外,您基本上可以使用任何不需要DOM的JS库(如json2.js等)

(从这里 )

查看以下论坛。 你可以通过删除它来使用Jquery http://developer.appcelerator.com/question/121/use-of-jquery

首先你应该创建一个htlm文件。 您应该在下面看到代码详情。 有jqueryfunction。 不要忘记上传jquery-1.9.min.js

     Local URL        

A Local Webpage

Touch to Fire Event
Listening...

app.js上的另一个更新代码块

 var win = Titanium.UI.createWindow({ title:"App to Web View Interaction Through Events", backgroundColor:"#FFFFFF" }); var webView = Titanium.UI.createWebView({ url:"html/index.html" }); var button = Titanium.UI.createButton({ title:"Fire WebView Javascript", height:48, width:220, bottom:12 }); button.addEventListener("click",function(e){ webView.evalJS("firedFromWebView('Fired!')"); }); //We can use a custom event listener to fire native code from Javascript pages //by using Titanium.App.addEventListener Titanium.App.addEventListener("fromWeb",function(e){ //The data structure and value of e is defined in the //index.html page alert(e.value); }); win.add(webView); win.add(button); win.open(); 
Interesting Posts