I am looking to implement stringByEvaluatingJavaScriptFromString in order to execute a JavaScript code that accesses local files (such as CSS or JS files) stored on the device (presumably in the Documents folder)...
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];
How can I make this work effectively? The function works perfectly when referencing an external CSS file, like
the_css.href='http://www.website.com/the_css.css';