1 //当完成webView加载时调用 2 - (void)webViewDidFinishLoad:(UIWebView *)webView{ 3 4 //如果有id 5 if (self.help.Id) { 6 //取得模型对应的id 7 NSString *js = [NSString stringWithFormat:@"window.location.href ='#%@'",self.help.Id]; 8 [webView stringByEvaluatingJavaScriptFromString:js]; 9 } 10 }