Skip to content

Commit c56fdb6

Browse files
committed
Merge pull request marcuswestin#75 from kanflo/master
marcuswestin#74 Not possible to load external javascript in ExampleApp.html
2 parents 47d9a9a + 92d4715 commit c56fdb6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Example Apps/ExampleApp-iOS/ExampleAppViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ - (void)callHandler:(id)sender {
8383
- (void)loadExamplePage:(UIWebView*)webView {
8484
NSString* htmlPath = [[NSBundle mainBundle] pathForResource:@"ExampleApp" ofType:@"html"];
8585
NSString* appHtml = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil];
86-
[webView loadHTMLString:appHtml baseURL:nil];
86+
NSURL *baseURL = [NSURL fileURLWithPath:htmlPath];
87+
[webView loadHTMLString:appHtml baseURL:baseURL];
8788
}
8889
@end

0 commit comments

Comments
 (0)