$code:
def getContents(fname):
a = req.get(fname)
return a.content
<script type="text/javascript">
document.write("$getContents('http://mysite.net')");
</script>
(Where req is passed on my template's $def with(), being a module
object of the Python Requests (http://python-requests.org), from which
I execute methods.)
Problem is, the document is blank, which means the document.write
function got no input. Is there a way around this? Am I doing this in
a wrong way?
Thanks in advance,
~ theiostream.
It's not. It works outside JavaScript.