You simply place the file under the application/yourapp/static/js/ folder
and you import it from the html.
You can import in the layout.html with <script
src="{{=URL('static','js/myfile.js')}}"></script> or you can import it from
the python code (model or controller) with
response.files.append(URL('static','js/myfile.js'))
This will generate the <script>...</script> for you.
On Friday, 21 March 2014 01:01:14 UTC-5, Haad Khan wrote:
>
> I am new to web2py and I was wondering how to add a javascript library. Do
> we add it to view. And how to import it into html. Using the same code
> <script src=> and what do we even place src=.
> I wanted to basically visualize a graph and was planning to use Arbor.js.
> Also if you know of some better javascript plotting library do mention it.
> Thanks
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.