-(void) Webviewdidfinishload: (UIWebView *) webview{nsstring *currenturl = [WebView stringbyevaluatingjavascriptfromstring:@ "Document.location.href"]; NSString *title = [WebView stringbyevaluatingjavascriptfromstring:@ "Document.title"]; NSString *js_result = [WebView stringbyevaluatingjavascriptfromstring:@ "Document.getelementsbyname (' Q ') [0].value= '] Heyuan110 '; "]; NSString *JS_RESULT2 = [WebView stringbyevaluatingjavascriptfromstring:@ "Document.forms[0].submit (); "]; NSLog (@ "%@====%@====%@====%@", CURRENTURL,TITLE,JS_RESULT,JS_RESULT2); [WebView stringbyevaluatingjavascriptfromstring:@ "var script = document.createelement (' script ');" " Script.type = ' text/javascript '; "" Script.text = \ "Function myFunction () {" "var field = document.getelementsbyname (' q ') [0];" " Field.value= ' heyuan110.com '; "" Document.forms[0].submit (); ""} \";" " document.getElementsByTagName (' head ') [0].appendchild (script); "]; [WebView Stringbyevaluatingjavascriptfromstring:@ "MyFunction ();"];}
IOS WebView Interactive