“Uncaught ReferenceError: jQuery is not defined” Android chromium

匿名 (未验证) 提交于 2019-12-03 01:40:02

问题:

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>" + 


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