title: UIWebView calling JS with arguments won't work
body: <p>I have a UIWebView with a HTML page inside. Now I want to call a JS function inside the HTML and pass some values from Objective-C variables in it.</p>
  
  <pre><code>-  (void) webViewDidFinishLoad:(UIWebView *)_webView{
      NSString *selectedValue = [_webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"initWithDataFromObjC(%@)", @"hello"]];
  
      NSLog(@"webViewDidFinishLoad %@", @"YES");
  }
  </code></pre>
  
  <p>The JS function in the HTML file:</p>
  
  <pre><code>  function initWithDataFromObjC(param1) {
             alert(param1);        
    }            
  </code></pre>
  
  <p>When I run the App in the simulator sometimes it loads my HTML correct, sometimes it stuck and don't finished loading. But nevertheless it don't show a popup with "hello"!</p>
  
  <p>If I change the coding to the following:</p>
  
  <pre><code>-  (void) webViewDidFinishLoad:(UIWebView *)_webView{
      NSString *selectedValue = [_webView stringByEvaluatingJavaScriptFromString:@"initWithDataFromObjC()"];
  
      NSLog(@"webViewDidFinishLoad %@", @"YES");
  }
  </code></pre>
  
  <p>The JS function without any parameters</p>
  
  <pre><code>function initWithDataFromObjC() {
        alert("hello");        
  } 
  </code></pre>
  
  <p>The second construct will run without any issues. But I'm wondering why I don't work properly when I try to pass in some parameters?</p>
  
  <p>BR &amp; THX,</p>
  
  <p>mybecks   </p>