I try to bring back in controller initialization for jquery plugins because
I am not using them everywhere most of the time and also because sometimes
I initialize them differently in particular Datatables... Also, when I
change version of the plugin I found my self to always forgot a views that
contains a plugin... So I have little fix to do... I would avoid or
minimize those little issue and I thought that bring the initalization
script in controller where I spend most of my time could be a good move...

Richard

On Tue, Feb 21, 2012 at 5:35 PM, Anthony <[email protected]> wrote:

> Ok, understand that, but is the response.js should allow me to insert this
>> in my view :
>>
>> <script type="text/javascript"> $(".chzn-select").chosen(); </script>
>>
>
> response.js does not insert a script tag into the page. Instead, the
> javascript function that makes the ajax call to load the component reads
> the response.js code from a special response header and eval's the code.
>
>
>>
>> Is there a way to insert a script into a view from controller... It may
>> be consider script injection I don't know...
>>
>
> If it's a web2py component, why not just include the above script element
> in the component's view?
>
> Anthony
>
>

Reply via email to