Re: [Dev] Is it possible to insert jaggery code segment in to javascript?
Thank you Nadeesha. It worked. Thanks & Regards, Sajini. On Wed, Apr 23, 2014 at 2:33 PM, Nadeesha Cabral wrote: > Hello Sajini, > > Jaggery is server-side javascript. Meaning, the javascript you write in > the browser will not be aware of jaggery code unless you make it explicitly > available to be so. > > Assuming you have a variable serverSideFoo defined inside jaggery (var > serverSideFoo = 'bar') you can make it available to the client side > javascript by writing it to the page. > > > var clientSideFoo = '<%= serverSideFoo %>'; > > > Cheers, > Nadeesha. > > > On Wed, Apr 23, 2014 at 2:22 PM, Sajini De Silva wrote: > >> Hi, >> >> I want to access a variable defined in jaggery inside javascript code >> segment. Does jaggery support this? >> >> Thanks & Regards, >> Sajini. >> >> -- >> Sajini De SIlva >> Software Engineer; WSO2 Inc.; http://wso2.com , >> Email: saj...@wso2.com >> Blog: http://sajinid.blogspot.com/ >> Git hub profile: https://github.com/sajinidesilva >> >> >> ___ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Is it possible to insert jaggery code segment in to javascript?
Hello Sajini, Jaggery is server-side javascript. Meaning, the javascript you write in the browser will not be aware of jaggery code unless you make it explicitly available to be so. Assuming you have a variable serverSideFoo defined inside jaggery (var serverSideFoo = 'bar') you can make it available to the client side javascript by writing it to the page. var clientSideFoo = '<%= serverSideFoo %>'; Cheers, Nadeesha. On Wed, Apr 23, 2014 at 2:22 PM, Sajini De Silva wrote: > Hi, > > I want to access a variable defined in jaggery inside javascript code > segment. Does jaggery support this? > > Thanks & Regards, > Sajini. > > -- > Sajini De SIlva > Software Engineer; WSO2 Inc.; http://wso2.com , > Email: saj...@wso2.com > Blog: http://sajinid.blogspot.com/ > Git hub profile: https://github.com/sajinidesilva > > > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
[Dev] Is it possible to insert jaggery code segment in to javascript?
Hi, I want to access a variable defined in jaggery inside javascript code segment. Does jaggery support this? Thanks & Regards, Sajini. -- Sajini De SIlva Software Engineer; WSO2 Inc.; http://wso2.com , Email: saj...@wso2.com Blog: http://sajinid.blogspot.com/ Git hub profile: https://github.com/sajinidesilva ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev