2012/04/09 08:10:34 | (127.0.0.1) {h1 include} {canvas id:canvas; width:300; height:300; | } {div id:console; | xxx } {p {submit code:code; | go}} {pre id:code; |!! // a call to this function will include the file jsPath function includeJS(jsPath){ var script = document.createElement("script"); script.setAttribute("type", "text/javascript"); script.setAttribute("src", jsPath); document.getElementsByTagName("head")[0].appendChild(script); } // include includeJS( 'pages/draw.js.txt' ); // and do it if (draw != undefined) $('canvas').innerHTML = draw(); else $('console').innerHTML = 'Encore un clic !'; !!}