tags:

views:

28

answers:

1

hi all. How can i generate a dynamiccal html code in iphone like below:

NSString sHtml = @"<html><form name= \"PIOform\" >\ 
                            <input type=\"text\" name=\"txtUserName\" >\
                            <input type=\"text\" name=\"txtPassWord\" >\
                         </form>\
                         <input type=\"button\" onclick=\"goCallLogin(PIOform)\" >
                   </html>";

Yes, I want to create an UI iphone application with feature like a client HTML form to call a javascript method in any server: When i click a button in iphone. It will call goCallLogin(PIOform) method in JS at address: http;//www.myserver.com/login.js

How can i do? Thank you

+1  A: 

This seems like something better suited for an iPhone web app than a native app. Maybe you should look into doing that instead? There is no need to create HTML like this with a native app. If you want to send values to a remote server from a native app, take a look at writing a web service and accessing it from the iPhone. You could use REST or XML-RPC to activate the goCallLogin method that you were referring to.

Also, you cannot just call a javascript through a web browser and expect it to work. Javascript is a client-side technology. You need to look into writing your web service with a server-side language/framework such as PHP, Ruby on Rails, ASP.NET, etc.

Marc W