Sample code
Taken from examples/svgExport and making use of jQuery
<script type="text/javascript" src="libGUIDOEngine.js"></script>
<script>
	var guidoEngine;
	function processGMN() {
		var p = guidoEngine.openParser();
		var ar = guidoEngine.string2AR(p, $("#gmnSandbox").val());
		guidoEngine.closeParser(p);
	
		var gr = guidoEngine.ar2gr(ar);
		var result = guidoEngine.gr2SVG(gr, 1, true, 0);
		guidoEngine.freeGR(gr);
		guidoEngine.freeAR(ar);
	
		$("#canvasContainer").html(result);
	}
	$( document ).ready(function() {
		guidoEngine = new Module.GuidoEngineAdapter;
		guidoEngine.init();
		$("#gmnSandbox").on('keyup', processGMN);
	});
	$(window).unload(function(){
		guidoEngine.shutdown();
		delete guidoEngine;
	});
</script>


The Guido Engine library is an open source library for the layout and the graphic rendering of music scores developped and maintained by the Grame Computer Music Research Lab.

Get the Guido library at SourceForge.net