开发者

Call controller method inside javascript function

Opah!

Is there any way I can call a method in the controller through a javascript code? I am wanti开发者_如何学JAVAng to destroy a Session to leave a specific page.

Thanks!


the simplest way to do this IMO is with javascript, calling

$.ajax(url: 'controller/action',success: function(data) { //do whatever with your result... }) 

you can also use $.get(), $.post()...

see jQuery - Ajax API for more.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜