我想的JavaScript加載到一個UIWebView,這裏是javascript代碼ios - 如何將JavaScript加載到UIWebview?
<script type=\"text/javascript\">
window.external =
{
'Notify': function(s) { document.location = 'acs://settoken?token=' + s; },
'notify': function(s) { document.location = 'acs://settoken?token=' + s; }
};
</script>
- (void) webViewDidFinishLoad:(UIWebView *)webView
{
//Here how to call the above javascript
[webView stringByEvaluatingJavaScriptFromString:@"";
}
請參閱本[http://iphoneincubator.com/blog/windows-views/how-to-inject-javascript-functions-into-a-uiwebview(HTTP: //iphoneincubator.com/blog/windows-views/how-to-inject-javascript-functions-into-a-uiwebview) – Ashini 2013-04-25 03:57:35
你已經知道使用什麼方法。你有什麼問題? – 2013-04-25 03:57:41
我知道這個方法,但是當我試圖實現這個JavaScript代碼時,我得到了一個錯誤,如期待'['令牌和字符太恆定,所以你能告訴我如何打電話嗎?我只是初學者 – user2315206 2013-04-25 04:04:27