py4web - javascript references in html files

41 views
Skip to first unread message

Jim S

unread,
Jan 19, 2020, 12:35:27 PM1/19/20
to web2py-users
I'm wondering why in py4web you're not using the URL function to specify the location of .js files.  This can be seen in layout.html and auth.html.  I also see that at the top of layout.html that you define:

<base href="[[=URL('static')]]/">

I recall this being the best way to define them in web2py.

Comments?

-Jim

Massimo Di Pierro

unread,
Jan 21, 2020, 2:04:40 AM1/21/20
to web2py-users
Good question. Not sure there is a way that is best.
You are free to use URL everywhere but often it is not-necessary, specifically because all static files have the same prefix. It is therefore faster and more concise to use the above syntax.

Jim Steil

unread,
Jan 21, 2020, 8:37:41 AM1/21/20
to web...@googlegroups.com
I tried using URL() but then the login page didn't work.  I think there was an error starting Vue.

-Jim

--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/RDHVdivJsZg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/1eb242f5-3406-40f3-a41a-2cde6dc4b5f6%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages