ajax asd will paginate

i am use will_paginate using ajax my code is following

in controller
         def index

    #@images = Image.all
  @images = Image.paginate :page => params[:page], :per_page => 2
    respond_to do |format|
      #format.html # index.html.erb
      #format.xml { render :xml => @images }
    format.js{
        render :update do |page|
      page.replace_html 'mcont', :partial => 'search'
      end
    }
    end
  end

in _searhc file
        <div>
  <% @images.each do |i| %>
    <%=h i.name%>
  <%end%>
  <%= will_paginate @images %>
</div>
i want replace in index file
         <div id="mcont">
         </div>

but i got error try {
jQuery}