ios 调用本地html,如何将动态值传到html里
展开全部
showwebview stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"var script = document.createElement('script');"
"script.type = 'text/javascript';"
"script.text = \"function myFunction() { "
"var field = document.getElementsByName('aaa')[0];"
"field.value=;"%@
"document.forms[0].submit();"
"}\";"
"document.getElementsByTagName('head')[0].appendChild(script);", xxx];
xxx填入你要的字符串变量
"script.type = 'text/javascript';"
"script.text = \"function myFunction() { "
"var field = document.getElementsByName('aaa')[0];"
"field.value=;"%@
"document.forms[0].submit();"
"}\";"
"document.getElementsByTagName('head')[0].appendChild(script);", xxx];
xxx填入你要的字符串变量
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询