Grails: AJAX onSuccess method not triggering
===

I am using the jquery library with the grails remoteFunction tag to make an AJAX call in the event of a mouseover. The from a println I wrote I know the designated action is being called, but the onSuccess function is never triggered. I am new to AJAX and JS in general, so I might be overlooking something very obvious right now. Here is my code snippet.

gsp:

    <script type="text/javascript">

	function change()
	{
	
	document.getElementById('changer').src='${resource(dir: "images/images", file: "heart_red.png")}';
	}

	function onSuccess(data){
		
		alert("Has hearted:");
		
	}

</script>

    <img class="user_profile_pic" src="${user.profilePicture}" onmouseover="${remoteFunction(controller:'user', action: 'hasHearted', onSuccess: 'onSuccess(data)', params:[userID: user.id])}"/>

groovy:

    	def hasHearted = {
		println "Recieved user ID: $params.userID" 
		if(some condition...){
			[hasHearted: true] as JSON
		}
		else{
			[hasHearted: false] as JSON
		}
		
	}
