func evaluateJs (_ script: String) {
if
let webView = webView {
if
let uiWebView = webView as? UIWebView {
uiWebView.stringByEvaluatingJavaScript(from: script)
}
else
if
let wkWebView = webView as? WKWebView {
wkWebView.evaluateJavaScript(script, completionHandler: nil)
}
}
else
{
log
(
"webView is nil"
)
}
}
请发表评论