sudhanshu.swastik
sudhanshu.swastik

Reputation: 137

catching JS log on xcode console using web view

can any one help me in catching the JS log message on xcode console, JS has to be run on web view (UIWebView).

Upvotes: 3

Views: 817

Answers (1)

adali
adali

Reputation: 5977

to receive message from one webview use custom url scheme just like "log:yourlogmsg"

js code

window.location = "log:yourlogmsg";

use

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

and return false;

Upvotes: 2

Related Questions