title: What is WKErrorDomain error 4 from WKWebView
body: <pre><code>fatal error: LPWebView encounters an error: Error Domain=WKErrorDomain Code=4 
  "A JavaScript exception occurred" UserInfo=0x79d9c700 
  {NSLocalizedDescription=A JavaScript exception occurred}
  </code></pre>
  
  <p>I encountered this error when I tried to evaluate a JavaScript function with WKWebView.</p>
  
  <p>I used <code>loadHTMLString</code> to load a template to the webview.</p>
  
  <pre><code>let bundle = NSBundle.mainBundle()
  
  if let editorURL = bundle.URLForResource(self.kTemplateName, 
                                                withExtension: "html") {
    var error : NSError?
    //get html string from editor.html
    if let htmlString = String(contentsOfURL: editorURL, encoding: NSUTF8StringEncoding, error: &amp;error){
      if error != nil {
        assertionFailure("error encountered reading html string for \(error)")
      } else {
        self.loadHTMLString(htmlString, baseURL: bundle.bundleURL)
      }
    }
  
  } else {
    assertionFailure("LPWebView template not found")
  }
  </code></pre>
  
  <p>I wonder what this error code means and how to solve it?</p>
  
  <p>Thank you very much!</p>