I'm trying to run the same code as this page to add a datepicker to my input: http://jqueryui.com/demos/datepicker/ so on this page if you click on the input box, a date picker table is displayed. this is the code to my page:
<?xml version="1.0" encoding="UTF-8" ?>
<!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:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/js/jquery.js"></script>
<script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/js/datepicker.js"></script>
<script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/js/widget.js"></script>
<link rel="icon"
type="image/png"
href="#{facesContext.externalContext.requestContextPath}/resources/images/askbirdfavicon.png"/>
<link href="#{facesContext.externalContext.requestContextPath}/resources/css/form.css" rel="stylesheet" type="text/css" />
<link href="#{facesContext.externalContext.requestContextPath}/resources/css/datepicker.css" rel="stylesheet" type="text/css" />
<link href="#{facesContext.externalContext.requestContextPath}/resources/css/adminnavbar.css" rel="stylesheet" type="text/css" />
<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.24/themes/base/jquery-ui.css" type="text/css" media="all"/>
<link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.8.24/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/external/jquery.bgiframe-2.1.2.js" type="text/javascript"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/ui/minified/i18n/jquery-ui-i18n.min.js" type="text/javascript"></script>
<title>AskBird</title>
</h:head>
<h:body>
<h:form id="form" >
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
<div class="demo">
Date: <input type="text" id="datepicker" class="hasDatepicker"/>
</div><!-- End demo -->
<script>
$(document).ready(function () {
$("p").text("The DOM is now loaded and can be manipulated.");
});
</script>
<p>Not loaded yet.</p>
</h:form>
</h:body>
</html>
My jquery library is surely loaded, because as can be seen from the following picture "The DOM is now loaded message is displayed instead of "not loaded" in my paragraph element.
Also to make sure that my datepicker.js library is loaded I put an empty div with the id of "datepicker" to the code to see a calendar displaying on my page. (again you see it in the pic). The problem is that by clicking on my input, nothing is popped. Because that's how it works in the page that I provided above. What do you think I'm doing wrong?