As I looked into the forums I found many many discussion which said that If the javascript is not detected then add the <h:head> tag and it will get the javascripts and css. Well, this helped in many many cases.
But I have a file called masterTemplate.xhtml and it used by another file(say xyz.xhtml). Now when I include the head tag in masterTemplate.xhtml the corresponding javascript and css are shown. but the including file's (xyz.xhtml's) javascript is shown to have errors. What could be the problem for this. Any ideas or suggestions :
In masterTemplate.xhtml
<h:head>
<ui:insert name="js">
<script type="text/javascript">
function validatePage(){
return true;
}
</script>
</ui:insert>
</h:head>
Similarly in xyz.xhtml
<ui:define name="js">
<script type="text/javascript">
//<![CDATA[
function myname(){
alert("My name");
}
// ]]>
</script>
</ui:define>
However, If I remove the <h:head> the the javascript in xyz.xhtml works. Do you have any clues.