how to create a connection between two webview, and also it should communicate. These both webview contains javascript. One thing more how to invoke javascript methods from ojective c(Xcode).
Asked
Active
Viewed 199 times
0
-
something is wrong with the grammar please don't mind – sudhanshu.swastik Apr 19 '12 at 04:53
-
what do you mean by connection do you mean communicating ? – Arpit B Parekh Apr 19 '12 at 05:22
-
elaborate your problem tat exactly which events you want to trigger ? – Arpit B Parekh Apr 19 '12 at 05:23
-
event is to place text on web veiw, right now i dont have java script, but i will be getting within an hour... – sudhanshu.swastik Apr 19 '12 at 05:37
-
1better way is to check the delegate methods of uiwebview :). – Arpit B Parekh Apr 19 '12 at 05:39
1 Answers
2
use
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
to receive message from one webview use custom url scheme just like "command:cmd"
and
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script;
to execute cmd in js format to send msg to another webview

adali
- 5,977
- 2
- 33
- 40
-
http://stackoverflow.com/questions/2873899/javascript-in-uiwebview-callback-to-c-objective-c this link is also similar. – Arpit B Parekh Apr 19 '12 at 06:00