如何从控制器调用javascript函数 [英] How to call a javascript function from a controller

查看:77
本文介绍了如何从控制器调用javascript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从控制器调用javascript函数



例如:

i有两个控制器,如A和B



我从控制器'A'调用控制器'B',我需要使用javascript从控制器'B'返回值'x'到'A'



i我正在使用

返回内容(< script language ='javascript'type ='text / javascript'> window.location ='javascript: history.go(-2)'< /脚本>中);

返回,所以我需要返回值'x'以及这个。



有没有办法包含一个javascript函数在这里面?

How to call a javascript function from a controller

For eg:
i have two controllers like A and B

i'm calling Controller 'B' from controller 'A' and i need to return a value 'x' from controller 'B' to 'A' using javascript

i am using
return Content("<script language='javascript' type='text/javascript'>window.location='javascript:history.go(-2)'</script>");
for returning ,so i need to return the value 'x' along with this.

is there any way to include a javascript function inside this??

推荐答案

希望这个 [ ^ ]帮助。


这篇关于如何从控制器调用javascript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆