how to integrate javascript in iPhone application?
i am new in iphone application 开发者_运维知识库and i want to integrate the javascript so would you please give some information about how to implement javascript?
I don't know what exactly you mean by
i want to integrate the javascript
You have full JS support inside UIWebView. You can inject your own JS code and communicate with the existing JS code.
According to the policy set by Apple on applications for the iPhone, you can not use any interpreted language. Thus, Javascript is unfortunately out of the question.
This is stated in the iPhone SDK agreement.
3.3.2 — An Application may not itself install or launch other executable code by any means, including without limitation through the use of a plug-in architecture, calling other frameworks, other APIs or otherwise. No interpreted code may be downloaded or used in an Application except for code that is interpreted and run by Apple’s Documented APIs and built-in interpreter(s).
Continuing with what Michael Kessler said you can also use javascript embedded in a UIWebView to access native iPhone functionality via libraries such as phoneGap making your javascript more powerful than the normal safari variety.
http://phonegap.com/download
Includes a iPhone project that you can use as a basis for your javascript application.
精彩评论