“Uncaught ReferenceError: jQuery is not defined” A

2019-08-17 03:53发布

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条回答
成全新的幸福
2楼-- · 2019-08-17 04:29

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>" +
查看更多
登录 后发表回答