Put something like this at the end of your page:
<div id="jsrun"></div>
<script>
ajax('../response_url', [''], 'jsrun');
</script>
create a function that returns data:
def response_url():
return '''
YOUR DATA OR EVEN JSSCRIPT HERE
'''

