I am developing a simple pyramid application where I use jQuery to execute AJAX requests. I still had my javascript code in my chameleon patterns. Now I want to extract my javascript to another location (e.g. as static resources).
My problem is that I believe that my javascript code relies on dynamically generated content:
$.post("${request.route_url('my_view')}",{'data': 'some data'}, function(html){
$("#destination").html(html);
});
Dynamic Element:
"${request.route_url('my_view')}"
Which calls the route_url method of the request object in the template.
Is there a recognized template for splitting such javascript files into my own templates and providing routes and views for them, or am I just saving my javascript in my page template?
source
share