我遇到了一個非常不尋常的可能是noobish的問題。 Wordpress上有這個網站,我必須在webview中顯示。它會對名稱和電子郵件的輸入進行一些檢查,然後Next
按鈕顯示其餘內容(最有可能是JS,但確實實現 - 在web編程中目前太糟糕了)。它在移動瀏覽器上的工作也很好。Android WebView無法加載(可能)Javascript雖然瀏覽器確實
問題是,webview似乎沒有執行任何操作點擊Next
按鈕。我搜索了一些SO問題,並用webview設置做了許多試驗和錯誤,但無濟於事。
啓用Javascript的web視圖,順便說一句。這裏是網址的鏈接,如果有人想知道(也可以告訴我)究竟是什麼問題:http://www.stressandanxietymanagement.com/stress-test/
也許我錯過了一些非常基本的東西。順便說一句,請不要在答覆中發佈網址。解決此問題後,我可能不得不刪除鏈接。
編輯:logcats也顯示一些相關的
11-05 03:50:56.319 19071-19071/innovation.stressmanagement I/chromium: [INFO:CONSOLE(2)] "JQMIGRATE: Migrate is installed, version 1.4.1", source: http://www.stressandanxietymanagement.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1 (2)
11-05 03:52:00.619 19071-19071/innovation.stressmanagement I/chromium: [INFO:CONSOLE(54)] "Uncaught TypeError: Cannot read property 'getItem' of null", source: http://www.stressandanxietymanagement.com/wp-content/plugins/quiz-master-next/js/qmn_quiz.js?ver=4.6.1 (54)
11-05 03:52:11.849 19071-22147/innovation.stressmanagement W/chromium: [WARNING:keycode_converter.cc(91)] empty code string
11-05 03:52:12.396 19071-22147/innovation.stressmanagement W/chromium: [WARNING:keycode_converter.cc(91)] empty code string
11-05 03:52:16.612 19071-22147/innovation.stressmanagement W/chromium: [WARNING:keycode_converter.cc(91)] empty code string
11-05 03:52:21.136 19071-22147/innovation.stressmanagement W/chromium: [WARNING:keycode_converter.cc(91)] empty code string
11-05 03:52:23.873 19071-22147/innovation.stressmanagement W/chromium: [WARNING:keycode_converter.cc(91)] empty code string
11-05 03:52:26.920 19071-22147/innovation.stressmanagement W/chromium: [WARNING:keycode_converter.cc(91)] empty code string
11-05 03:52:27.983 19071-22147/innovation.stressmanagement W/chromium: [WARNING:keycode_converter.cc(91)] empty code string
11-05 03:52:27.988 19071-22147/innovation.stressmanagement W/chromium: [WARNING:keycode_converter.cc(91)] empty code string
11-05 03:52:29.597 19071-22147/innovation.stressmanagement W/chromium: [WARNING:keycode_converter.cc(91)] empty code string
11-05 03:52:30.528 19071-22147/innovation.stressmanagement W/chromium: [WARNING:keycode_converter.cc(91)] empty code string
11-05 03:52:32.503 19071-22147/innovation.stressmanagement W/chromium: [WARNING:keycode_converter.cc(91)] empty code string
11-05 03:52:46.558 19071-19071/innovation.stressmanagement I/chromium: [INFO:CONSOLE(54)] "Uncaught TypeError: Cannot read property 'getItem' of null", source: http://www.stressandanxietymanagement.com/wp-content/plugins/quiz-master-next/js/qmn_quiz.js?ver=4.6.1 (54)
的Uncaught TypeError
顯示在點擊Next
按鈕。但問題是,它如何在web瀏覽器上正常工作,但在webView中卻不能正常工作?
編輯:
我用這個Advanced WebView Library這工作得很好。所以,如果其他人仍然有類似的問題,試試這個庫(或任何其他選擇)。
但是,我想知道爲什麼WebView
小部件內置工作不正常。
感謝
檢查logcat的日誌 – petey
@petey他們似乎並沒有被給予任何暗示。他們大多數只是「表面」。 「LibEGL」相關但沒有任何錯誤顯示。 –
一個建議是將其掛接到遠程Chrome調試:https://developers.google.com/web/tools/chrome-devtools/remote-debugging/並查看該頁面的功能。您也可以調試網頁瀏覽https://developers.google.com/web/tools/chrome-devtools/remote-debugging/webviews –