[Android] Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'


我們開發的產品,有一部分功能,需要在WebView中打開web頁面,然后在web頁面中通過js方法回調部分native的功能。

對於web回調native的開發方式,如果不了解的話,可以參考我以前的一篇博文《Android中Webview使用自定義的javascript進行回調》http://blog.csdn.net/arui319/article/details/7044638 

最近測試發現,在某些最新機型上(4.2及以上),JS回調好像不起做用了。打開log,提示Uncaught TypeError: Object [object Object] has no method 'xxx' 。其中xxx就是web頁面中寫的js方法名。

仔細研究,發現是因為Android4.2及以上版本對於js的支持方式有改變導致(又是一起新版本導致的不兼容事件,最近這種事情越來越多了)。具體的,請看下面這篇文章,寫的很詳細了,沒有必要再寫一遍了,請直接參考吧。http://blog.csdn.net/zgjxwl/article/details/9627685

記錄於此,方便網友查詢。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 TypeError: 'method' object is not iterable Uncaught (in promise) TypeError: Object(...) is not a function 解決Uncaught TypeError: object is not a function 2.在使用"node-xlsx" 模塊時報" TypeError: Object function Object() { [native code] } has no method 'assign' " Uncaught TypeError: Cannot assign to read only property 'exports' of object '#' Uncaught TypeError: Cannot convert object to primitive value Uncaught TypeError: Cannot convert undefined or null to object TypeError at /index.html/ 'method' object is not subscriptable 錯誤類型:TypeError: 'method' object is not subscriptable selenium | TypeError:object of type ‘WebElement’ has no len()
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM