Android WebView不会加载javascript图表

时间:2015-10-30 15:32:26

标签: javascript android webview

我有一个显示图表的网页。它使用javascript,jquery,bootstrap和angular.js。在我的Android应用程序中,我尝试使用WebView加载此图形。这是android.support.v4.app.Fragment中的代码。

WebView webView = (WebView) rootView.findViewById(R.id.webview_webview);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(getArguments().getString(MY_URL));

当我启动片段时,这是我得到的日志:

10-30 13:09:57.655: W/art(31893): Attempt to remove local handle scope entry from IRT, ignoring
10-30 13:09:57.659: W/AwContents(31893): onDetachedFromWindow called when already detached. Ignoring
10-30 13:09:57.796: W/cr.BindingManager(31893): Cannot call determinedVisibility() - never saw a connection for the pid: 31893
10-30 13:09:58.052: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/modernizr.js (1)
10-30 13:09:58.055: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.min.js (1)
10-30 13:09:58.057: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.gritter/js/jquery.gritter.js (1)
10-30 13:09:58.060: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.niftymodals/js/jquery.modalEffects.js (1)
10-30 13:09:58.062: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/masonry.js (1)
10-30 13:09:58.065: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.nanoscroller/jquery.nanoscroller.js (1)
10-30 13:09:58.068: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.ui/jquery-ui.js (1)
10-30 13:09:58.072: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.sparkline/jquery.sparkline.min.js (1)
10-30 13:09:58.074: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.easypiechart/jquery.easy-pie-chart.js (1)
10-30 13:09:58.077: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.nestable/jquery.nestable.js (1)
10-30 13:09:58.082: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/bootstrap.switch/bootstrap-switch.min.js (1)
10-30 13:09:58.093: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/bootstrap.datetimepicker/js/bootstrap-datetimepicker.min.js (1)
10-30 13:09:58.096: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/bootstrap.clockpicker/js/bootstrap-clockpicker.min.js (1)
10-30 13:09:58.101: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.icheck/icheck.min.js (1)
10-30 13:09:58.104: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.select2/select2.min.js (1)
10-30 13:09:58.107: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.parsley/parsley.js (1)
10-30 13:09:58.109: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/skycons/skycons.js (1)
10-30 13:09:58.119: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/bootstrap.slider/js/bootstrap-slider.js (1)
10-30 13:09:58.119: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/intro.js/intro.js (1)
10-30 13:09:58.119: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.maskedinput/jquery.maskedinput.js (1)
10-30 13:09:58.121: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.crop/dist/cropper.js (1)
10-30 13:09:58.123: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/datepicker/js/jquery-ui.js (1)
10-30 13:09:58.126: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/angular.min.js (1)
10-30 13:09:58.128: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/angular-ui-router.js (1)
10-30 13:09:58.133: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/angular-animate.min.js (1)
10-30 13:09:58.133: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/toaster.js (1)
10-30 13:09:58.305: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/infobox.js (1)
10-30 13:09:58.306: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/markerclusterer.js (1)
10-30 13:09:58.307: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/highstock.js (1)
10-30 13:09:58.308: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/exporting.js (1)
10-30 13:09:58.310: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/ng-highcharts.js (1)
10-30 13:09:58.311: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.upload/js/jquery.iframe-transport.js (1)
10-30 13:09:58.312: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.upload/js/jquery.fileupload.js (1)
10-30 13:09:58.315: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/behaviour/general.js (1)
10-30 13:09:58.317: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/behaviour/voice-commands.js (1)
10-30 13:09:58.319: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/bootstrap/dist/js/bootstrap.min.js (1)
10-30 13:09:58.321: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.flot/jquery.flot.js (1)
10-30 13:09:58.323: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.flot/jquery.flot.pie.js (1)
10-30 13:09:58.324: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.flot/jquery.flot.labels.js (1)
10-30 13:09:58.326: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery.icheck/icheck.min.js (1)
10-30 13:09:58.328: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/ui-bootstrap-tpls-0.10.0.min.js (1)
10-30 13:09:58.329: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/bootstrap/ui-bootstrap-tpls-0.10.0.js (1)
10-30 13:09:58.343: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/moment.min.js (1)
10-30 13:09:58.345: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jquery-ui/jquery-ui.custom.min.js (1)
10-30 13:09:58.349: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/bootstrap-colorpicker.min.js (1)
10-30 13:09:58.352: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/bootstrap-timepicker.min.js (1)
10-30 13:09:58.354: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/bootstrapValidator.min.js (1)
10-30 13:09:58.355: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/jQuery-Storage-API/jquery.storageapi.js (1)
10-30 13:09:58.357: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/fullcalendar/dist/fullcalendar.js (1)
10-30 13:09:58.358: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/fullcalendar/appcalendar.js (1)
10-30 13:09:58.359: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/pt-br.js (1)
10-30 13:09:58.361: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/gcal.js (1)
10-30 13:09:58.362: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/LAB.min.js (1)
10-30 13:09:58.365: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/aside/angular-aside.js (1)
10-30 13:09:58.366: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//app/app/app.js (1)
10-30 13:09:58.368: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//app/app/data.js (1)
10-30 13:09:58.370: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//app/app/directives.js (1)
10-30 13:09:58.371: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//app/app/controllers.js (1)
10-30 13:09:58.373: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//app/app/modules.js (1)
10-30 13:09:58.374: I/chromium(31893): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: mydomain//js/sweetalert-master/dist/sweetalert.min.js (1)

如您所见,存在“意外令牌&lt;”页面中加载的每个javascript文件的错误。我认为这个错误可能是一个错误,因为页面通常在任何浏览器中加载。

以前有人见过这个吗?我该怎么办?感谢。

1 个答案:

答案 0 :(得分:0)

错误在于服务器中的文件权限。