Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I reference JQuery SRC URL in JSF
    text
    copied!<p>I'm using JSF 2.0. I have </p> <pre><code>&lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"&gt;&lt;/script&gt; &lt;script language="text/javascript" &gt; </code></pre> <p>in my source, but when I deploy it, I'm getting:</p> <pre><code>&lt;SCRIPT type=text/javascript src="appmonitorgreeting_xhtml_files/jquery-latest.min.js"&gt;&lt;/SCRIPT&gt; </code></pre> <p><a href="https://stackoverflow.com/questions/14748145/how-to-include-external-javascript-file-in-a-jsf-page">This</a> suggessts that you can just add the URL the normal way, but for some reason JSF is stripping out my url and just using the file name. Here's the full head in case it helps:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core"&gt; &lt;h:head&gt; &lt;meta charset="utf-8" content=""/&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"/&gt; &lt;meta name="description" content=""/&gt; &lt;meta name="author" content=""/&gt; &lt;meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7"/&gt; &lt;h:outputStylesheet library="css" name="appmonitor.css"/&gt; &lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"&gt;&lt;/script&gt; &lt;script language="text/javascript" &gt; function show(area) { var obj = document.getElementById(area) obj.style.display = (obj.style.display == 'inline') ? 'none' : 'inline' }; jQuery(document).ready(function() { alert("see it does work"); }); &lt;/script&gt; &lt;/h:head&gt; </code></pre> <p>How do I make it use <a href="http://code.jquery.com/jquery-latest.min.js" rel="nofollow noreferrer">http://code.jquery.com/jquery-latest.min.js</a> as the src?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload