IOS: Call javascript function from native code
Today I've some work with UIWebview and Javascript. I'm using NativeBridge to call ios function from Javascript. It's quite simple, so I've decided to take note for any further use in the future. NSString *Data = @"Data You Want To Pass To Javascript Function"; [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"jsFunc('%@')",Data]]; Notice that when you're passing a string to a javascript function, you must put that data inside a pair of ' sign.