該表達式似乎不起作用。這是與Mac應用程序,而不是iPhone應用程序。stringByEvaluatingJavaScriptFromString無法正常工作
[[mainWebView mainFrame] stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.getElementById('username').value='%@';document.getElementById('password').value='%@';", [ebuddyidField value], [passwordField value]]];
它說'沒有-evaluateWebScript:找到方法'。這是我的代碼:\t [[mainWebView windowScriptObject] evaluateWebScript:[的NSString stringWithFormat:@「的document.getElementById( '用戶名')值= '%@';的document.getElementById( '密碼')值= '%@'。 ;「,[ebuddyidField value],[passwordField value]]]; – icant 2011-01-30 09:38:49
你有沒有`#import`? –
2011-01-30 09:43:07