I don't understand, perhaps you have trought of simply embeding a
script tag, with the body code of the function, and I don't know why
this is not ok for you.
<script>
var foo = { bar: function () {} };
</script>
<button onclick="foo.bar()" />
--
--
ℱin del ℳensaje.