如何从控制器调用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??