1
uiwebviewのスクリプトをURLとしてロードする方法は?スクリプトをUIWebView url
私はこれ試してみてください。
-(IBAction)rulButtonPressed:(id)sender{
[_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"#1 onclick=s=document.createElement('script');s.src='http://sidio.ru/rul/last30.js.php?'+Math.random();document.body.appendChild(s);"]]];
}
が、その、今、私は質問は少しあいまいですが、あなたはおそらく使用したいボタン
[OK]を、私はこのJavaScriptをロードする必要がありますのonclick = S =のdocument.createElement( 'スクリプト'); s.src =」 http://sidio.ru/rul/last30.js.php?'+Math.random();document.body.appendChild(s);私はボタンrulButtonPressedをタップしたとき – nik1004
あなたは多分 ' - (IBAction)rulButtonPressed:(id)sender {[_webView stringByEvaluatingJavaScriptFromString:@" document.createElement( 'script'); s.src = 'http: /sidio.ru/rul/last30.js.php?'+Math.random();document.body.appendChild(s); "]; } ' – chown
ありがとうございました!今はその作品!) – nik1004