JavaScript函数返回我想要包含在页面中的HTML文件的虚拟路径和文件名, 我如何在include语句中使用JavaScript变量?
这是代码:
<div id="vcontainer" runat="server" >
<script type="text/javascript">
var srcFile = "~/Views/D1C1.html";
// this works <!--#include virtual="~/Views/D1C1.html" -->
this doesn't <!--#include virtual=srcFile -->
</script>
</div>