Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • To call and send parameters to java Script function from Objective C

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 216
    Comment on it

    To call javascript function write the following lines :

    NSString *getStringvalue=[webView stringByEvaluatingJavaScriptFromString:@"getName()];

    Where getName() is a JavaScript function which return a String value.


    and to send Objective C variable to JavaScript function:

    [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"setDetails(\%@\,\%@\);,firstName,lastName]];

    where setDetails is a javaScript function with firstName and lastName as a parameters.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: