Issues finding jquery in Chrome

UI Components for JSF
Post Reply
GLee
Posts: 21
Joined: 10 Nov 2014, 17:47

26 Jan 2022, 21:10

Created app in PrimeFaces 6.0 with no issues in Chrome. As soon as I moved the app to an SSL/HTTPS URL the page is scrambled and I get these errors in Chrome dev console:

Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
jquery.js.xhtml:1 Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
primefaces.js.xhtml:1 Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
idlemonitor.js.xhtml:1 Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
primefaces.css.xhtml:1 Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
jquery-plugins.js.xhtml?ln=primefaces&v=5.2:5 Uncaught ReferenceError: jQuery is not defined
at jquery-plugins.js.xhtml?ln=primefaces&v=5.2:5:85
at jquery-plugins.js.xhtml?ln=primefaces&v=5.2:5:94
watermark.js.xhtml?ln=primefaces&v=5.2:1 Uncaught ReferenceError: jQuery is not defined
at watermark.js.xhtml?ln=primefaces&v=5.2:1:4891

Looked around on the 'Net and found that I needed to explicitly define where jquery is located, so I added the "src" section to the <script> tag:
<script language="JavaScript" type="text/javascript" src="/resources/javascript/jquery-2.0.3-min.js">

When I add the reference to jquery-2.0.3 my scripts no longer work. Again, this is Chrome. Seems to be fine in Safari and FireFox.

Wondering how to fix this. I don't mind upgrading to PrimeFaces 11 or any other version provided I include the correct JQuery version.

jepsar
Posts: 166
Joined: 03 Sep 2014, 11:41
Location: NL / BE
Contact:

27 Jan 2022, 10:23

Don't load your own jQuery. It is provided by PrimeFaces. Loading your own will likely cause issues. https://stackoverflow.com/questions/161 ... typeerrors
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub: https://github.com/jepsar
Spotify: 90s Rave, Acid, Trance, House

GLee
Posts: 21
Joined: 10 Nov 2014, 17:47

27 Jan 2022, 16:54

Yes, I understand that loading my own Jquery might cause issues, but it's not finding the one provided by PrimeFaces when I access the app using SSL and a specific port like "https://localhost:7003/app_name"

It's also not finding my css and the other PrimeFaces included components:

Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
lis.css.xhtml:1 Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
jquery.js.xhtml:1 Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
core.js.xhtml:1 Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
idlemonitor.js.xhtml:1 Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
components.css.xhtml:1 Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
jquery-plugins.js.xhtml?ln=primefaces&v=11.0.0:5 Uncaught ReferenceError: jQuery is not defined
at jquery-plugins.js.xhtml:5:85
at jquery-plugins.js.xhtml:5:95

GLee
Posts: 21
Joined: 10 Nov 2014, 17:47

27 Jan 2022, 17:22

When I added the <h:outputScript> tag for PrimeFaces JQuery as suggested in the TaskOverflow post, the error was a different.

It no longer complained about JQuery. It still needs to find watermark.js.xhtml and components.js.xhtml. I assume these are internal to PrimeFaces.

I have a feeling it's the port designation in the URL that is causing this.

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

28 Jan 2022, 16:52

To me it sounds like you have something wrong with your WAR or deployment?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 20 guests