首页 > 解决方案 > Chrome 没有给出引导代码的预期输出

问题描述

我正在使用引导程序。我已经添加了对引导库的所有必要引用,但它仍然无法在 google chrome 中运行。这是我得到的输出的屏幕截图:

在此处输入图像描述

我在“这是一个 Jumbotron”文本上使用了 jumbotron,但它不起作用。我的 HTML 代码如下:

     <!DOCTYPE html>
        <html lang="en">
          <head>
            <!-- Required meta tags -->
            <meta charset="utf-8">
            <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        
            <!-- Bootstrap CSS -->
            <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
        
            <title>Hello, world!</title>
          </head>
          <body>
            <h1>Hello, world!</h1>
        
            <!-- Optional JavaScript -->
            <!-- jQuery first, then Popper.js, then Bootstrap JS -->
            <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
            <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
        
            <div class="Jumbotron">
        This is a Jumbotron.
            </div>
          </body>
        </html>

如您所见,此代码中包含参考,但它仍然无法在 chrome 中使用。请注意,我已从 bootstrap.com 入门模板复制了此代码。那么,我的浏览器有问题吗?如果你知道答案,请回答这个问题。提前致谢。此代码没有 CSS。我还使用 Visual Studio Code 作为我的代码编辑器。

标签: twitter-bootstrapgoogle-chrome

解决方案


我找到了答案:这与代码编辑器无关,而是我在 Chrome 中安装了一个扩展程序,它不允许我访问脚本链接(通过脚本网站)。一旦我删除了扩展(或者你可以尝试禁用它),引导程序又开始工作了。这个答案适用于任何面临与我相同问题的人。


推荐阅读