Sorry for the noise, I struggled with """ for long time and didn't
realise that I wasn't need "eval()" anymore...
I don't need js var and eva(); at all as long as I have XML()
# In view
{{if request.args(0)=='SOMETHING':}}
{{=XML(conditional_field_trigger_selected_event_js)}}
{{pass}}
Rich
I had to use XML() to avoid $quot; in the view, like this :
# In controller
conditional_field_trigger_selected_event_js
= '$("select[name=FIELDOFINTERESS]").change(function() {var val =
$(this).children(":selected").attr("value");$(this).trigger($(this).attr("id")
+ "__selected", [val]);});'
...
Hello Anthony in order to do what you propose here, I mean passing
javascript code from the controller to the view by mean of return
dict(var=js), I think the only way I have to execute the passed js code is
to use eval in the view like this :
eval({{=var}});
Now, my concern is, is that secure
you already tried something like that:
The actual script is in an external script file called "xxx.js".
Ovidio Marinho Falcao Neto
ovidio...@gmail.com
88269088
Paraiba-Brasil
2011/6/6 David J.
> I tried this it worked
I tried this it worked on the fields but it seemed to have disabled the
rest of the web2py_ajax javascript;
Maybe I am doing something wrong;
$("#myfield").valudate(number);
On 6/5/11 7:43 PM, Anthony wrote:
Can't you just include the relevant JS directly in the view template
for the pa
Can't you just include the relevant JS directly in the view template for the
page, or maybe include the JS string in the dict returned by the controller,
and insert it as a variable in the view?
On Sunday, June 5, 2011 6:22:13 PM UTC-4, David J wrote:
> How do I inject javascript in my controll
6 matches
Mail list logo