forum

Home / DeveloperSection / Forums / How to get javascript variable's value in iOS app?

How to get javascript variable's value in iOS app?

Anonymous User 1626 12-Nov-2014

I need to access a javascript variable which is declared inside a try block in the script

var ErrorResponse = "";

in my iOS app. I don't have much idea about javascript thats why I am unable to find out the way to do it. I am using this:

NSString *jsString = @"var temp = ErrorResponse; return temp";

NSString *myFieldValue1 = [self.viewYTParser stringByEvaluatingJavaScriptFromString:jsString];

to retrieve the value but it returns an empty string.


Updated on 12-Nov-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By