A grails var can be accessed in javascript using $ notation
var rsData = '${ruleSetData}';If you want to convert it to JSON use encodeAsJSON()
var objJSONData = '${gObject.encodeAsJSON()}'and parse this object in javascript using
var parsedJSONData = eval(objJSONData);This obj can then be used in JS as
for(var i=0; i< parsedJSONData.length; i++){ alert(parsedJSONData[i].propertyName); }