views:

68

answers:

0

I have tried in many ways that specified in many threads. Still my WebView not loading the local js files. The way that I have tried

NSString *tempResourcePath=[[NSBundle mainBundle] resourcePath];
NSURL *resourceUrl = [NSURL fileURLWithPath:tempResourcePath];
[webView loadHTMLString:html baseURL:resourceUrl];


NSString *html = [[NSString alloc] initWithContentsOfFile:htmlPath];
    NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
    //resourcePath = [resourcePath stringByReplacingOccurrencesOfString:@"/" withString:@"//"];
    resourcePath = [resourcePath stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
    resourcePath = [NSString stringWithFormat:@"file:/%@/",resourcePath];
 NSURL *resourceUrl = [NSURL fileURLWithPath: resourcePath];

but the webview not working. Could anyone please help me out in fixing this problem?