开发者

Call controller method inside javascript function

开发者 https://www.devze.com 2022-12-25 06:27 出处:网络
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.

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

精彩评论

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