I am looking for a way to include jQuery javascript library in my project so that I can use
[myWebView stringByEvaluatingJavaScriptFromString:a jquery command]
This does not work:
NSString *jQueryPath = [[NSBundle mainBundle]pathForResource:@"jquery-1.4.1" ofType:@"js"];
NSData *jQueryData = [[NSData alloc] initWithContentsOfFile:jQueryPath];
jQuery = [[NSMutableString alloc] initWithData:jQueryData encoding:NSUTF8StringEncoding];
NSString *javaScript = [jQuery stringByAppendingString:@"$('#ct100_mainContent_hypEmbGamerTag img').attr('src');"];
NSString *returnValue = [theWebView stringByEvaluatingJavaScriptFromString:javaScript];
I think this has something to do with how Objective-C handles the / character.
Any suggestions?
source
share