I have a cool bit of dojo running where I click a button and it brings a success message on开发者_Python百科 the screen via JavaScript. Is it possible to issue a call to a server-side Groovy script (eg. foo.groovy
) from within this JavaScript?
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.
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.
The answer was to use dojo's AJAX call system.
精彩评论