本文介绍了在ASP页面中使用javascript变量和#include的正确语法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道如何将 JavaScript变量 #include 声明一起使用



我似乎无法忍受为了得到正确的语法,如果它是可能的



谢谢



我试过的:



< div id =vcontainerrunat =server> 
< script type =text / javascript>
// var srcFile = getmmView('<%#Container.EvalDataItem(FileName_wo_ext)%>');
var srcFile =〜/ Views / D1C1.html<<上面的函数返回一个像这样的字符串

//这个工作<! - #include virtual =〜 /Views/D1C1.html - >
//这不是<! - #include virtual = + srcFile + - >
//这不是document.write(<! - #include virtual ='+ srcFile +' - >)

< / script>
< / div>
解决方案

Anyone know how to use JavaScript variable with an #include statement

I can't seem to get the syntax right, if it's even possible

thanks

What I have tried:

<div id="vcontainer" runat="server" >
 <script type="text/javascript">
//var srcFile = getmmView('<%# Container.EvalDataItem("FileName_wo_ext") %>');
      var srcFile = "~/Views/D1C1.html"  <<above function returns a string like this

// this works <!--#include virtual="~/Views/D1C1.html" -->
//this doesn't  <!--#include virtual=+srcFile+ -->
//this doesn't  document.write("<!--#include virtual='"+srcFile+ "'-->")

</script>
</div>
解决方案


这篇关于在ASP页面中使用javascript变量和#include的正确语法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 12:59
查看更多