Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

knut

macrumors newbie
Original poster
Jun 30, 2009
21
0
Hi All
I have a problem with calling js function.
I have already loaded html and from my c code i try call js function but no result.
when I write everything perfect
Code:
NSString * _script = @"document.getElementById('Text').innerHTML;";
NSString * res = [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:_script]];
but wen I try call function I get null result i.e
NSString * _script = @"function test(){window.location = '/playSong/1';}";
NSString* result = [webView stringByEvaluatingJavaScriptFromString:_script];

who can help me?
Thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.