I tried the $:. It keeps not displaying, and then gives me escaping issues.
On Nov 24, 10:05 am, Tom <tom.thorog...@gmail.com> wrote: > 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 <daniel.calib...@gmail.com> 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 webpy@googlegroups.com. To unsubscribe from this group, send email to webpy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/webpy?hl=en.