Adding js to my JSF page
843844Feb 23 2010 — edited Feb 23 2010Hey
I am trying to add javaScript functionality to my JSF page. I have been trying almost everything and still I cant figure it out.
The last version:
Adding this line to my JSF page:
<f:verbatim>
<script src="#{facesContext.externalContext.requestContextPath}/resources/javascript/chat.js" >
</script>
</f:verbatim>
Remark: The js file is located under: IceFacesExample3\IceFacesExample3\WebRoot\resources\javascript
<------------------------------------------------------------------------------------------------------->
In - chat.js I have only one function trying to alert some data:
function KeyDownHandler()
{
window.alert("natalie");
return true ;
}
<------------------------------------------------------------------------------------------------------->
In my JSF page I am calling KeyDownHandler :
<ice:inputText id="txtMsg" value="#{eITMessagesListRequest.message}" onkeypress="KeyDownHandler()"></ice:inputText>
<------------------------------------------------------------------------------------------------------->
I assume the js file can't be reached!!! I was trying also to locate the js file in the same place my JSF files are located and using,
<f:verbatim>
<script src="chat.js" >
</script>
</f:verbatim>
I hope some one can help me!!!!
Thanks,Natalie
Edited by: nataly_afota7777 on Feb 23, 2010 4:59 AM