how to use variants into "%= javascript"-section ? (non Lite)

35 views
Skip to first unread message

bvn13

unread,
May 10, 2012, 6:22:58 AM5/10/12
to mojol...@googlegroups.com
Hi!

I need to use a variant in javascript-section (in template) like this:

% my $test1 = "test";

%= javascript begin

alert("$test"); ??? the symbol "$" is interpreted as text... but I need to identify some css-selector, named as is given from a controller stash... does this supported in Mojo?

% end

Stanislav Blinov

unread,
May 10, 2012, 6:25:06 AM5/10/12
to mojol...@googlegroups.com
Why not
alert("<%== $test %>"); ?
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/mojolicious/-/zRZxfzMpk9sJ.
> To post to this group, send email to mojol...@googlegroups.com.
> To unsubscribe from this group, send email to
> mojolicious...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mojolicious?hl=en.

Gabriel Vieira

unread,
May 10, 2012, 6:25:51 AM5/10/12
to mojol...@googlegroups.com
<script>
alert('<%=$test%>')
</script>

Solves?

--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mojolicious/-/zRZxfzMpk9sJ.
To post to this group, send email to mojol...@googlegroups.com.
To unsubscribe from this group, send email to mojolicious...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mojolicious?hl=en.



--
Gabriel Vieira

bvn13

unread,
May 11, 2012, 2:43:54 AM5/11/12
to mojol...@googlegroups.com
Thank you! It's all I need :)

четверг, 10 мая 2012 г., 14:25:51 UTC+4 пользователь Gabriel Vieira написал:

bvn13

unread,
May 11, 2012, 2:45:35 AM5/11/12
to mojol...@googlegroups.com
Thank you. I was just afraid to try :)

четверг, 10 мая 2012 г., 14:25:06 UTC+4 пользователь Stanislav Blinov написал:
Reply all
Reply to author
Forward
0 new messages