如何在JSF中引用JQuery SRC URL

时间:2013-11-26 00:56:15

标签: jquery jsf

我正在使用JSF 2.0。我有

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script language="text/javascript" >

在我的源代码中,但是当我部署它时,我得到了:

<SCRIPT type=text/javascript 
src="appmonitorgreeting_xhtml_files/jquery-latest.min.js"></SCRIPT>

This建议您可以按正常方式添加URL,但由于某种原因,JSF正在删除我的网址并仅使用文件名。如果它有帮助,这里是完整的负责人:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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">
  <h:head>
    <meta charset="utf-8" content=""/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta name="description" content=""/>
    <meta name="author" content=""/>
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7"/>
    <h:outputStylesheet library="css" name="appmonitor.css"/>
 <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script language="text/javascript" >
    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");
});
</script>
  </h:head>

如何使用http://code.jquery.com/jquery-latest.min.js作为src?

0 个答案:

没有答案