在MVC中有2个视图说:
View-A contains A.js which further contains function A()
View-B contains B.js which further contains function B()
现在我想从function A()
文件
View-B's B.js
我不能做什么: -
#1 I can`t embed A.js into View-B
#2 I can`t embed A.js into _Layout.cshtml
如果可以,请告诉我怎么做?
答案 0 :(得分:0)
您可以在视图B中使用getScript
$.getScript('jsfile.js',function(){
//call function A
});