Formatting client output

Hi everybody, I'm developping an app with Arduino Yun controlled by a web page with Javascript/Jquery. From Arduino Yun (server) I receive in the web page some data with this statement:

        function monOn(){
            handle = setInterval("showGetResult(function(data){$('#cont').text(data);});",2000);
            ......

This statement work without problems. But I woul'd make some formatting on the received text. How can I store the received data in a Javascript variable? I've already tried dozen of different versions like "var str = $('#cont').text(data);" and so on without succss. Could somebody give me a hint how to solve this issue? Thanks in advance and regards. Fabio