Javascript 使用asp.net窗体进行引导

Javascript 使用asp.net窗体进行引导,javascript,jquery,asp.net,twitter-bootstrap,Javascript,Jquery,Asp.net,Twitter Bootstrap,我正在asp.net表单应用程序中使用引导。我拥有项目中所有必需的文件: bootstrap.min.js jquery-2.0.3.min.js bootstrap.min.css 当我在根目录中添加一个内容页时,站点工作得非常好;所有引导功能都正常工作。但问题是,当我将内容放在另一个文件夹(例如webapp/content/default.aspx)中时,该站点在IE中不工作。在其他浏览器上,它显示内容,但引导功能根本不工作 我的脚本: <script src="js/jquery

我正在asp.net表单应用程序中使用引导。我拥有项目中所有必需的文件:

  • bootstrap.min.js
  • jquery-2.0.3.min.js
  • bootstrap.min.css
当我在根目录中添加一个内容页时,站点工作得非常好;所有引导功能都正常工作。但问题是,当我将内容放在另一个文件夹(例如webapp/content/default.aspx)中时,该站点在IE中不工作。在其他浏览器上,它显示内容,但引导功能根本不工作

我的脚本:

<script src="js/jquery-2.0.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>

您需要一个/ 如


更完整

  • 以斜杠开头使其相对于根网站目录
  • 两个句点../将使其上升一个目录(因此.././使其上升两个目录…)
  • ~/带您到项目目录的根目录
  • 否则,它是相对于当前文件所在的目录的。(因此js/jquery-2.0.3.min.js正在当前目录的js子文件夹中查找该文件。)

  • JQuery 2.0.x与一些旧浏览器不兼容。 使用最新的1.9.x版本

    请参见

    **尝试使用以下文件:**
    ie8-responsive-file-warning.js,
    html5shiv.js和
    respond.min.js。
    下载并将文件放在js文件夹中。
    **使用路径**
    “@Url.Content(“~/patch/file.js”)”
    ****范例****
    
    难道不是服务器端的概念吗?
    <script src="/js/jquery-2.0.3.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    
    **Try using the files:**
    ie8-responsive-file-warning.js,
    html5shiv.js and 
    respond.min.js.
    
    Make the Downloads and place the files in js folder.
    
    **Use the paths**
    
        "@Url.Content("~/patch/file.js")"
    
    
    
         ****Example****
    
    
        <head>
            <!-- Just for debugging purposes. Don't actually copy this line! -->
            <!--[if lt IE 9]><script src="@Url.Content("~/js/ie8-responsive-file-warning.js")"></script><![endif]-->
    
            <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
            <!--[if lt IE 9]>
              <script src="@Url.Content("~/js/html5shiv.js")"></script>
              <script src="@Url.Content("~/js/respond.min.js")"></script>
            <![endif]-->
    
            <script src="@Url.Content("~/js/jquery-2.0.3.min.js")"></script>
            <script src="@Url.Content("~/js/bootstrap.min.js")"></script>
    
          </head>