What should the content be? If it's more than text, don't forget to
add the colon: $:getContents('htttp://mysite.net')On Nov 23, 6:44 pm, theiostream <[email protected]> wrote: > I have been trying to make a page which combines web.py and > JavaScript, and with the following code: > > $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. -- You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/webpy?hl=en.
