PiJava

May 4, 2009

Using jQuery with RichFaces

Filed under: jQuery, RichFaces — Tags: , — pijava @ 12:35 pm

RichFaces includes jQuery JavaScript framework. You can use the futures of jQuery directly without defining the component on a page if it is convenient for you. To start using the jQuery feature on the page, include the library into a page with the following code:

<a4j:loadScript src="resource://jquery.js"/>

In order to test jQuery on your page

Add the following to the <body>:

 <a href="">Link</a>

Add the following to the page:

<script type="text/javascript">
  jQuery(document).ready(function() {
    jQuery("a").click(function() {
      alert("Hello world!");
     });
  });
</script>
  • Remember to use jQuery() function instead of $()

then just click the “Link”

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.