title: Using jquery with play framework 2.0
body: <p>I want to use jQuery to open a lightbox but it is causing the problem.
  Here is my <strong>Application.java</strong> code:</p>
  
  <pre><code>    @(products: List[Products])
  
      @import helper._
  
          &lt;script type="text/javascript" src="../public/javascripts/jquery-1.7.2.min.js"&gt;&lt;/script&gt;
          &lt;!-- Add mousewheel plugin (this is optional) --&gt;
          &lt;script type="text/javascript" src="../public/javascripts/jquery.mousewheel-3.0.6.pack.js"&gt;&lt;/script&gt;
  
          &lt;!-- Add fancyBox main JS and CSS files --&gt;
          &lt;script type="text/javascript" src="../public/javascripts/jquery.fancybox.js?v=2.0.6"&gt;&lt;/script&gt;
          &lt;link rel="stylesheet" type="text/css" href="../public/stylesheets/jquery.fancybox.css?v=2.0.6" media="screen" /&gt;
  
  
          &lt;script type="text/javascript"&gt;
          $(document).ready(function() {
  
  $('.fancybox').fancybox();
  
  // my code
             });
  // rest of the code
  </code></pre>
  
  <p>It gives me the error </p>
  
  <p><strong>ReferenceError: $ is not defined</strong> showed in firebug.
  i even tried changing $ with jQuery but still it doesnt work at all. Also i saw that the jQuery gets loaded in the head section.
  Do help me with this.</p>
  
  <p>conf/routes file:</p>
  
  <pre><code># Routes
  # This file defines all application routes (Higher priority routes first)
  # ~~~~
  
  # Home page
  #GET     /                           controllers.Application.index()
  
  # Map static resources from the /public folder to the /assets URL path
  GET     /assets/*file               controllers.Assets.at(path="/public", file)
  
  # Products list (to fetch the list of all the products)
  GET     /products                controllers.Application.list
  
  GET     /products/:id           controllers.Application.findAll1(id:Integer)
  </code></pre>