1
내 응용 프로그램의 사용자가 부하에 시도되는 웹 페이지 링크가
:stringByEvaluatingJavaScriptFromString 행동을 수행하지 않습니다
<a href="javascript:DoSubmitScr('1B'); SetTextOption('Detailed');" id="btn_14" class="Button1" style="position:relative;width:190px;">
을 그리고 이것을 호출하려고 자바 스크립트 블록 : 이제
function DoSubmitScr(scrval)
{
GlobalHelpUrl = HelpUrl;
document.getElementById("hScreen").name = "SCR";
document.getElementById("hScreen").value = scrval;
if (scrval.toUpperCase() == "1B") document.getElementById("main_iframe").scrolling = "no";
document.forms[0].target = "_parent";
document.forms[0].method = "post";
document.forms[0].action = "/wtouch/perinfo.exe/oper";
doSubmit();
}
내가 이 자바 스크립트를하려고 :
[webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('btn_14').click();"];
하지만 작동하지 않거나 내가 다음과 같이하려고 할 때 :
[webView stringByEvaluatingJavaScriptFromString:@"DoSubmitScr('1B');"];
이 자바 스크립트 메소드를 호출하는 방법에 대한 아이디어가 있습니까?
론
[이 답변] (http://stackoverflow.com/questions/17117713/passing-data-to-and-from-an-embedded-uiwebview/17118065#17118065) 도움이 될 수도 있습니다 – Alladinian
감사하지만 자바 스크립트는 webView.isLoading == NO 일 때 webViewDidFinishLoad에서 호출되므로 문제가되지 않습니다. 다른 아이디어? – Ron