开发者

How to detect java script in UIWebView

开发者 https://www.devze.com 2023-02-25 12:37 出处:网络
In a web page i have two select box, after select a value from first select box the second select box if fill by java script or may be Ajex. but in my UIWebView the second select box is not fill. so p

In a web page i have two select box, after select a value from first select box the second select box if fill by java script or may be Ajex. but in my UIWebView the second select box is not fill. so please help me. this is work well in safari web browser.

- (void)viewDidLoad {
    [super viewDidLoad];

    [myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlStr]]];
}


-(void)webViewDidStartLoad:(UIWebView *) portal {
    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; 
}

-(void)webViewDidFinishLoad:(UIWebView *) portal{
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 
}


- (void)开发者_如何学JAVAwebView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
    NSString *userInfo = [[error userInfo] objectForKey:NSURLErrorFailingURLPeerTrustErrorKey];
    NSLog(@"Connection failed! Error - %@ %@",[error localizedDescription],userInfo);   

    UIAlertView *alerView = [[UIAlertView alloc] initWithTitle:[error localizedDescription] message:userInfo delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil,nil];
    [alerView show];
    [alerView release]; 
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 
}


You should turn on the Debug Console in your mobile safari and look if there java script errors, else you should debug through with alerts.

Turn on Debug Console:

Open Settings -> Safari -> Developer (At the bottom) -> Debug Console on|off

0

精彩评论

暂无评论...
验证码 换一张
取 消