I have a webpage that shows a graph. It uses javascript, jquery, bootstrap and angular.js. In my android app I try to load this graph using a WebView. This is the code in the android.support.v4.app.Fragment.
WebView webView = (WebView) rootView.findViewById(R.id.webview_webview);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(getArguments().getString(MY_URL));
When I start the fragment, this is the log I get:
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)
As you can see, there is an "unexpected token <" error for each javascript file loaded in the page. I think this error maybe a mistake, because the page loads normally in any browser.
Have somebody seen this before? What can I try? Thanks.
Error was with file permissions in the server.
Related
Has anyone experience the following JavaScript syntax error inside a JavaScript file for a cookie alert and have a solution to it? I am getting the error code below.
SyntaxError: Unexpected token ':' at https://*******.com/assets/web/assets/cookies-alert-plugin/cookies-alert-script.js:16:447 at new Promise (<anonymous>) at b (https://*******.com/assets/web/assets/cookies-alert-plugin/cookies-alert-script.js:16:167) at https://***********.com/assets/web/assets/cookies-alert-plugin/cookies-alert-script.js:17:142
I'm trying to write Postman test and validate personal identification number with regexp. I have validated regexp: \b((([0-2]{1}[0-9]{1}|[3]{1}[0-1]{1})[0-9]{1}[0-9]{1}[0-9]{1}[0-9]{1}(.|\n|\t|)[0-9]{5})|[3]{1}[2]{1}[0-9]{4}(.|\n|\t|)[0-9]{5})\b
Postman test script:
var req = JSON.parse(pm.request.body.raw);
pm.expect(req.personnumber).to.match( \b((([0-2]{1}[0-9]{1}|[3]{1}[0-1]{1})[0-9]{1}[0-9]{1}[0-9]{1}[0-9]{1}(.|\n|\t|)[0-9]{5})|[3]{1}[2]{1}[0-9]{4}(.|\n|\t|)[0-9]{5}\b), "wwww" );
});
Postman returns following error while trying to execute test script:
There was an error in evaluating the test script: SyntaxError: Invalid or unexpected token
This error SyntaxError: Invalid or unexpected token comes from that you forgot about / in the beginning and end of regexp:
pm.expect(req.personnumber).to.match( /\b((([0-2]{1}[0-9]{1}|[3]{1}[0-1]{1})[0-9]{1}[0-9]{1}[0-9]{1}[0-9]{1}(.|\n|\t|)[0-9]{5})|[3]{1}[2]{1}[0-9]{4}(.|\n|\t|)[0-9]{5}\b)/, "wwww" );
I am getting Uncaught SyntaxError: Unexpected identifier for let declaration, the code is working fine when tested with APK on real device. I am checking for the error by inspecting device from chrome://inspect/#devices.
Javascript code is:
let options = {
width: 256,
height: 256,
colorDark: "#000000",
colorLight: "#ffffff",
};
Getting Error:Uncaught SyntaxError: Unexpected identifier
I am facing issue Js Uncaught SyntaxError PHP Website
Details of query :
URL is http://www.matoshreenisarg.com/about-us/dg
This URL should be redirected to 404 but this is not redirecting appearing inspect console error
*Uncaught SyntaxError: Unexpected token <
bootstrap.min.js:1
Uncaught SyntaxError: Unexpected token <
revolution.min.js:1
Uncaught SyntaxError: Unexpected token <
jquery.fancybox.pack.js:1
Uncaught SyntaxError: Unexpected token <
isotope.js:1
Uncaught SyntaxError: Unexpected token <
owl.js:1
Uncaught SyntaxError: Unexpected token <
jquery.gmap.js:1
Uncaught SyntaxError: Unexpected token <
jquery.easing.min.js:1
Uncaught SyntaxError: Unexpected token <
masterslider.js:1
Uncaught SyntaxError: Unexpected token <
wow.js:1
Uncaught SyntaxError: Unexpected token <
script.js:1
Uncaught SyntaxError: Unexpected token <*
use
/
in every external script/css call
For Example
src="/js/jquery.js" instead of src="js/jquery.js"
href="/css/style.css" instead of href="css/style.css"
calling the below function from html
displaySSHCmdResultDiv('12:21:08 up 4 days, 1:37, 3 users, load average: 0.44, 0.46, 0.44')
Throws me error "Uncaught SyntaxError: Unexpected token ILLEGAL " in chrome. can any one help me in identifying what the problem is .
As per your code function aruguments is 6 and its seprated by comma so you have complete single cot for each srting
displaySSHCmdResultDiv('12:21:08 up 4 days','1:37',' 3 users', 'load average: 0.44', '0.46', '0.44');