本地文件不可以url直接加参数,可以在uiwebview 加载好后 用js和oc 交互,传递参数。
参考:
NSURL *urlNosmoke = [NSURL URLWithString:[NSString stringWithFormat:@"nosmokeProgram.html"]];
NSString *strFilePath = [self.viewController.commandDelegate pathForResource:[urlNosmoke path]];
NSURL *urlNonSmoking = [NSURL URLWithString:@"?nonSmokingId=2013" relativeToURL:[NSURL URLWithString:strFilePath]];
NSURLRequest *req = [[NSURLRequest alloc] initWithURL:urlNonSmoking
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:20.0f];
[self.viewController.webViewEngine loadRequest:req];
使用ios中的jsapi调用