views:

27

answers:

2

When I add submitToRemote to my gsp I Firebug gives me an "Ajax not found" error. I have the jquery library loaded. How do I use submitToRemote with JQuery?

 <g:javascript library="jquery-1.4.2.min"/>
 <g:javascript library="jquery-ui-1.8.4.custom.min"/>
  .
  . 
  .
 <g:submitToRemote controller="DefaultSearchController" action="search" value="Search" onSuccess="updateResults(searchResults)"/>
+1  A: 

Need to includue the appropriate tag

how to use jquery for AJAX in Grails

http://www.grails.org/Ajax

http://www.grails.org/Tag+-+javascript

is the javascript tags included on the page?

Aaron Saunders
Yes the appropriate javascript tags are included. I have included them in the question.
nathan
@nathan did you use the jquery plugin as described in the first link in my answer? Using the plugin causes grails to use jQuery and not its default javascript library
Aaron Saunders
I had the jquery plugin pointing to the wrong js file in my configuration. I read that page 5 times, but after you answered I read it for the 6th and discovered my problem. Thanks, Aaron.
nathan
A: 

You need the jQuery JavaScript provider for the Ajax calls to work properly (or other tags that normally work with Prototype for that matter).

Check out http://www.grails.org/plugin/jquery

M.

Matthias Hryniszak