从iOS代码打开特定的html幻灯片

open specific html slide from iOS code

本文关键字:html 幻灯片 iOS 代码      更新时间:2023-09-26

我有5张幻灯片的html文件,我需要在文本字段(或如果按下按钮)中输入其数字时转到页面,我可以从哪里去这里(如何获得参考&打开它)这是我的代码

localContent = [[UIWebView alloc] initWithFrame:CGRectMake(0, 60, 1024, 768)];
   NSString *path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"inDirectory:@"Edge"];
    NSURL *url = [NSURL fileURLWithPath:path];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [localContent loadRequest:request];
    [self.view addSubview: localContent];

我使用的java脚本桥的例子发现在https://github.com/marcuswestin/WebViewJavascriptBridge

然后

  NSString *returnvalue = [hema stringByEvaluatingJavaScriptFromString:@"                    $('#txt').val(19)"];
NSString *returnvalue2 = [hema stringByEvaluatingJavaScriptFromString:@"  $('#Stage_Nav_Bar_go_to_slide').click()"
                          ];
[WebViewJavascriptBridge enableLogging];
_bridge = [WebViewJavascriptBridge bridgeForWebView:hema webViewDelegate:self handler:^(id data, WVJBResponseCallback responseCallback) {
}];