Skip to content

Instantly share code, notes, and snippets.

@antonevane
Created May 16, 2010 19:46
Show Gist options
  • Save antonevane/403110 to your computer and use it in GitHub Desktop.
Save antonevane/403110 to your computer and use it in GitHub Desktop.
def analyze = {
render "Content"
}
<div id="ajax_form">
<g:remoteLink action="analyze"
update="[success:'ajax_data',failure:'error']">Ajax Action</g:remoteLink>
</div>
<!-- Spinner Trick-->
<div id='spinner' class='spinner' style='display:none;'>
<img src='${createLinkTo(dir: 'images', file: 'spinner.gif')}' alt="Loading..." title="Loading..."/><p><g:message code="Идет загрузка.."/></p>
</div>
<div id="ajax_data">
<g:javascript src="jquery/jquery.js" />
<g:javascript>
$(document).ready(function() {
$("#spinner").bind("ajaxSend", function() {
$(this).fadeIn();
}).bind("ajaxComplete", function() {
$(this).fadeOut();
})
});
</g:javascript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment