views:

89

answers:

2

Hey!

I have a cool bit of dojo running where I click a button - and it brings a success message on the screen via javascript. Is it possible to issue a call to a server side Groovy script foo.groovy from within this Javascript - because not only do I want to show the cool success message - but I need to do some work in the background at that point also.

Thanks

Andy

A: 

The answer was to use dojo's AJAX call system.

RenegadeAndy
It would be nice, if you would post some example code snippets of your solution, to give others an idea how this can be achieved.
Christoph Metzendorf
+2  A: 

Here are some relevant links from the Dojo documentation:

  • Intro to AJAX and Dojo
  • Dojo.xhrGet() reference: sends a GET request to the server-side resource (which can be a Groovy script or anything else that resides on the server). The live examples on this page are currently broken, but I'm told this is being resolved.
  • Dojo.xhrPost() reference: sends a POST request. There are variants for PUT and DELETE too.
rewbs