当把html内容通过webView.loadUrl("javascript:displayHtml("htmlContent"); 的方式传递给 js去执行的时候
一定要注意 htmlContent 中的引号一定要被转义!
转义方式 webView().loadUrl("javascript:displayHtml(\""+htmlContent.replaceAll("\"", "\\\\\\\"")+"\")");
当把html内容通过webView.loadUrl("javascript:displayHtml("htmlContent"); 的方式传递给 js去执行的时候
一定要注意 htmlContent 中的引号一定要被转义!
转义方式 webView().loadUrl("javascript:displayHtml(\""+htmlContent.replaceAll("\"", "\\\\\\\"")+"\")");