Hi Himasha, AFAIU, Are you calling a javascript alert() function within a .jag script? If so, that should be the problem. We cannot call client-side javascript functions like "alert()" at server-side jaggery layer.
Cheers, Dilan. *Dilan U. Ariyaratne* Software Engineer WSO2 Inc. <http://wso2.com/> Mobile: +94775149066 lean . enterprise . middleware On Mon, May 25, 2015 at 10:57 AM, Himasha Guruge <[email protected]> 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 > [email protected] > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > >
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
