“Uncaught ReferenceError: jQuery is not defined” Android chromium

本秂侑毒 提交于 2020-01-06 14:13:17

问题


Jquery in my app not working well!!

webView.loadData(String.format(htmlText, post.getContent()), "text/html", null);

String str = "";

str = "<link rel='stylesheet' href='http://mysite.it/wp-content/plugins/scrollblog/js/couraselcss.css' />" +
        "<script type='text/javascript'>" +
        "<script src='http://code.jquery.com/jquery-1.9.0.min.js'></script>" +
      "<script src='http://mysite.it/wp-content/plugins/scrollblog/js/jquery.touchcarousel-1.1.min.js'></script>" +

in the log:

I/chromium(31613): [INFO:CONSOLE(3)] "Uncaught ReferenceError: jQuery is not defined", source: http://mysite.it/wp-content/themes/tiny-forge/customSelect/script2.js (3)

why?


回答1:


If you look inside the string concatenation it may hold the answer as to why. You are missing a closing </script> tag in the second line. Replace it with the following and things might just work.

str = "<link rel='stylesheet' href='http://mysite.it/wp-content/plugins/scrollblog/js/couraselcss.css' />" +
      "<script type='text/javascript'></script>" +
      "<script src='http://code.jquery.com/jquery-1.9.0.min.js'></script>" +
      "<script src='http://mysite.it/wp-content/plugins/scrollblog/js/jquery.touchcarousel-1.1.min.js'></script>" +


来源:https://stackoverflow.com/questions/22281195/uncaught-referenceerror-jquery-is-not-defined-android-chromium

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!