我一直在將應用程序從EJB遷移到JSF + Spring,並且這樣做,我將RichFaces從3.3.1更新到4.1.0。 現在我有以下問題所困擾,在鍍鉻控制檯顯示在RichFaces腳本中未定義jQuery
Uncaught ReferenceError: jQuery is not defined
像RichFaces的-event.js,popupPanel.js RichFaces的腳本
。
我知道,在HTML文件的頭文件中,應包括jQuery文件,但我已經查看過以前的應用程序,並且此腳本也包含在jQuery之前,並且沒有錯誤出現。更重要的是,我現在不如何我可以改變這一點,因爲這些腳本由具有隱含補充說:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
我怎樣才能解決這個問題?
<f:view contentType="text/html" locale="#{localeSelector.language}">
<h:head>
<title>#{messages['news.title']}</title>
<link rel="stylesheet" type="text/css" href="css/styles.css" />
<link rel="stylesheet" type="text/css"
href="css/jquery.lightbox-0.5.css" media="screen" />
<script type="text/javascript" src="js/jquery.lightbox-0.5.js"></script>
</h:head>
<h:body>
<h:outputScript name="jquery.js" library="js" target="head" />
<div id="container">
</div>
</h:body>
</f:view>
</html>
這裏的問題是不是收藏,但RichFaces.The HTML生成的代碼爲:
<script type="text/javascript" src="/ESA/javax.faces.resource/richfaces-event.js.xhtml"> </script>
<script type="text/javascript" src="/ESA/javax.faces.resource/popupPanel.js.xhtmlln=org.richfaces"></script>
<script type="text/javascript" src="/ESA/javax.faces.resource/popupPanelBorders.js.xhtml?ln=org.richfaces"></script>
<script type="text/javascript" src="/ESA/javax.faces.resource/popupPanelSizer.js.xhtml?ln=org.richfaces"></script>
<script type="text/javascript" src="/ESA/javax.faces.resource/jquery.js.xhtml?ln=js"> </script>
<script type="text/javascript" src="/ESA/javax.faces.resource/jquery.lightbox-0.5.js.xhtml?ln=js"></script>
不過是我將應用程序遷移,代碼是相同的,控制檯不顯示任何錯誤
你可以顯示你的文件的其餘部分?你直接導入jQuery嗎?你使用''嗎?你從'/ lib'文件夾中刪除了以前的庫嗎? –
skuntsel
已添加代碼。 如您所見,我使用了''標籤,但它仍然不起作用。 清除了'/ lib'文件夾,並且沒有以前的庫出現在那裏。 –
Nav