title: Get a javascript variable's value in iOS app
body: <p>I need to access a javascript variable which is declared  inside a try block in the script</p>
  
  <pre><code>var ErrorResponse = "";
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>NSString *jsString = @"var temp = ErrorResponse; return temp";
  NSString *myFieldValue1 = [self.viewYTParser stringByEvaluatingJavaScriptFromString:jsString];
  </code></pre>
  
  <p>to retrieve the value but it returns an empty string.</p>