Skip to content

Instantly share code, notes, and snippets.

@kArTeL
Forked from mladjan/gist:5939623
Created July 18, 2014 17:56
Show Gist options
  • Save kArTeL/7bd62a91bfd8f1476d10 to your computer and use it in GitHub Desktop.
Save kArTeL/7bd62a91bfd8f1476d10 to your computer and use it in GitHub Desktop.
-(void)webViewDidFinishLoad:(UIWebView *)webView{
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"jquery" ofType:@"js"];
NSData *fileData = [NSData dataWithContentsOfFile:filePath];
NSString *jsString = [[NSMutableString alloc] initWithData:fileData encoding:NSUTF8StringEncoding];
[webView stringByEvaluatingJavaScriptFromString:jsString];
NSString *filePath2 = [[NSBundle mainBundle] pathForResource:@"spritely" ofType:@"js" inDirectory:nil];
NSData *fileData2 = [NSData dataWithContentsOfFile:filePath2];
NSString *jsString2 = [[NSMutableString alloc] initWithData:fileData2 encoding:NSUTF8StringEncoding];
[webView stringByEvaluatingJavaScriptFromString:jsString2];
NSString *filePath3 = [[NSBundle mainBundle] pathForResource:@"main" ofType:@"js" inDirectory:nil];
NSData *fileData3 = [NSData dataWithContentsOfFile:filePath3];
NSString *jsString3 = [[NSMutableString alloc] initWithData:fileData3 encoding:NSUTF8StringEncoding];
[webView stringByEvaluatingJavaScriptFromString:jsString3];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment