[Product-Developers] Best approach to conditional JavaScript includes

toutpt toutpt at gmail.com
Sun Jan 23 13:13:18 UTC 2011


It is a widget and the best is to merge resources together to have as fewer
http request as possible

Lets include your javascript in portal_javascript and do not have condition.
Your js is not supposed to do sth if it doesn't find the widget in the page.

The best in my opinion is to have one big js resource for anonymous, one
more for  authenticated user. If your js can be used by both (this is the
case with a z3cform widget) just include it without a condition.


-----
Jean-Michel François aka toutpt
http://toutpt.wordpress.com
http://twitter.com/toutpt

-- 
View this message in context: http://plone.293351.n2.nabble.com/Best-approach-to-conditional-JavaScript-includes-tp5950758p5952669.html
Sent from the Product Developers mailing list archive at Nabble.com.



More information about the Product-Developers mailing list