WebView Javascript cross domain from a local HTML file
问题 I load a local html file (from assets folder) to the app WebView. In the HTML I run a jQuery.getJSON(url). the url is a remote server. This action fails, and I'm guessing because of a different origin issue (cross domain). I run the same file on chrome and there it specifically says so. Is there a way to allow the WebView in Android to load data from remote server on a local loaded HTML file? 回答1: Today morning I found solution that seems to be working. The Java part Initialize your WebView: