Another approach, maybe a simple approach, is to use the grails gsp tag. Using this, you can get rid of the javascript function and so you will remove everything between your tags or comment it out just to see how things work and do something like:
<g:remoteLink controller = "controller" action = "displayerror" update = "time">Error!</g:remoteLink>
<div id = "time">
</div>
<%-- Below this line is your old code that is commented out -->
<%-- <r:script>--%>
<%-- $(function () {--%>
<%-- $("#errorMessage").click(function(e) {--%>
<%-- e.preventDefault();--%>
<%-- $("#time").load(this.href);--%>
<%-- });--%>
<%-- });--%>
<%-- </r:script>--%>
Replace "controller" in the above code with whatever your concerned controller's name is.