<script type="text/javascript"> window.onload = function(){ var f1 = (function(a){return a*a;}); var f2 = (function(a){return a*a;}); alert(f1(1)+';'+f2(2)); }; </script>