Hi All, Yes, the issue was regarding directly calling a client-side function. Therefore passed the required attributes through a session, and called the functions from the client-side.
Thanks, On Tue, May 26, 2015 at 10:13 AM, Sajith Ariyarathna <sajit...@wso2.com> wrote: > Hi Himasha, > > Jaggery scripts runs in the server-side. Hence, you cannot use client-side > JavaScript functions such as 'alert'. Please make sure that "/js/actions.js" > have only server-side functions. > > Thank you. > > On Mon, May 25, 2015 at 10:57 AM, Himasha Guruge <himas...@wso2.com> > wrote: > >> Hi All, >> >> I have a .jag file(startProcess.jag) that needs to call a javascript >> function (showStatus()). In the .jag, I have added a require statement to >> get the .js file and calling the function through that like below. >> >> >> var process = require("/js/actions.js"); >> process.showStatus(id); >> >> In the controller all the jags are included, and jquery/bootstrap >> references are added in footer.jag. My controller looks like below. >> >> include("/template/startProcess.jag"); >> ... >> include("/template/partials/footer.jag"); >> But at the execution of the process, it gives undefined error for methods >> such as 'alert'. (Methods that are used within showStatus()). What could be >> the reason for this? I came across [1] , so if this is the same issue in >> this scenario as well, is there any workaround? >> >> [1] >> http://stackoverflow.com/questions/11258888/referenceerror-alert-is-not-defined >> >> Thanks, >> >> Himasha Guruge >> *Software Engineer* >> WS*O2* *Inc.* >> Mobile: +94 777459299 >> himas...@wso2.com >> >> _______________________________________________ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Sajith Ariyarathna > Software Engineer; WSO2, Inc.; http://wso2.com/ > mobile: +94 77 6602284, +94 71 3951048 > -- Himasha Guruge *Software Engineer* WS*O2* *Inc.* Mobile: +94 777459299 himas...@wso2.com
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev