0

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

これが可能であれば、plsはどのように教えてくれますか?

4

1 に答える 1

0

getScriptビューBで使用できます

$.getScript('jsfile.js',function(){
  //call function A 
});
于 2012-05-27T12:23:07.387 に答える