stringByEvaluatingJavaScriptFromStringを使用して、デバイス(ドキュメントフォルダー内)にあるローカルファイル(この場合はcssファイルですが、場合によってはjsファイルも)を参照するjavascriptを実行したいと思います...
NSString *theJS = [[NSString alloc]
initWithString:@"javascript:(function()
{the_css.rel='stylesheet';
the_css.href='the_css.css';
the_css.type='text/css';
the_css.media='screen';}
)();"];
[webView stringByEvaluatingJavaScriptFromString:theJS];
これをどのように機能させるのですか?次のような外部cssファイルを使用すると正常に動作します
the_css.href='http://www.website.com/the_css.css';