谷歌审核问题

发布于 2024-10-07 23:01:23 字数 1470 浏览 2 评论 0原文

以下外部 CSS 文件是 包含在外部 JavaScript 之后 文件在文档头中。为确保 CSS 文件是并行下载的, 始终在之前包含外部 CSS 外部 JavaScript。 1 个内联脚本 在头部之间发现了块 外部 CSS 文件和另一个 资源。允许并行 下载,移动内联脚本 在外部 CSS 文件之前或之后 下一个资源。

我的 HTML 是:

<head>

    <link rel="Stylesheet" href="gStyle.css" />        
    <script type="text/javascript" src="gMain.js"></script>
    <script type="text/javascript" language="javascript">

       // Your chart object(s)
        var myChart;

        // Function to hold all chart creation
        function initCharts() {

            myChart = new ganttChart("chart1");

            myChart.gAddBar("Dynamic!", "22/3/2010", "3/4/2010");

            myChart.gLoadData("Going to the shop*4/3/2010*19/3/2010*Watching TV*9/3/2010*23/3/2010*Watching TV*1/3/2010*23/3/2010*Watching TV*18/3/2010*28/3/2010*END INPUT*1/3/2010*9/3/2010");

            myChart.gDraw();

            myChart.gChangeBarColour(1, "#dd2200");
            myChart.gChangeBarColour(2, "#9900ee");
            myChart.gChangeBarColour(3, "#00dd00");
            myChart.gChangeBarColour(4, "#ffbb00");
            myChart.gChangeBarColour(5, "#00aa99");

        }

    </script>

</head>

<body onload="initCharts()">




    <div id="chart1" class="gContainer">     


    </div>

    <div id="db"></div>

</body>

主体内联脚本之间是否感到困惑?

The following external CSS files were
included after an external JavaScript
file in the document head. To ensure
CSS files are downloaded in parallel,
always include external CSS before
external JavaScript. 1 inline script
block was found in the head between an
external CSS file and another
resource. To allow parallel
downloading, move the inline script
before the external CSS file, or after
the next resource.

My HTML is:

<head>

    <link rel="Stylesheet" href="gStyle.css" />        
    <script type="text/javascript" src="gMain.js"></script>
    <script type="text/javascript" language="javascript">

       // Your chart object(s)
        var myChart;

        // Function to hold all chart creation
        function initCharts() {

            myChart = new ganttChart("chart1");

            myChart.gAddBar("Dynamic!", "22/3/2010", "3/4/2010");

            myChart.gLoadData("Going to the shop*4/3/2010*19/3/2010*Watching TV*9/3/2010*23/3/2010*Watching TV*1/3/2010*23/3/2010*Watching TV*18/3/2010*28/3/2010*END INPUT*1/3/2010*9/3/2010");

            myChart.gDraw();

            myChart.gChangeBarColour(1, "#dd2200");
            myChart.gChangeBarColour(2, "#9900ee");
            myChart.gChangeBarColour(3, "#00dd00");
            myChart.gChangeBarColour(4, "#ffbb00");
            myChart.gChangeBarColour(5, "#00aa99");

        }

    </script>

</head>

<body onload="initCharts()">




    <div id="chart1" class="gContainer">     


    </div>

    <div id="db"></div>

</body>

Is it getting confused between the body inline script?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

落花浅忆 2024-10-14 23:01:23

检查页面元素。也许您的 Chrome 扩展正在动态地将脚本添加到 HEAD 中的页面。

Inspect the page elements. Probably your Chrome extensions are dynamically adding scripts to the page in HEAD.

血之狂魔 2024-10-14 23:01:23

我认为当下载 javascript 时,浏览器必须等待获取所有内容然后运行它 - 这会阻止它直接进入下一行并获取它。我猜样式都会被下载,然后计算继承位置和重要性等......这样它们就可以并行下载。

这种事情在 CMS 中很难通过加载自己的样式和 js 的组件来调节。

I think that when javascript is downloaded the browser must wait to get it all and then run it - this stops it going to the next line directly and getting it. I guess styles all get downloaded and then computed down to inheritance position and importance etc...so they can download in parallel.

This kind of thing is hard to regulate in a CMS with components that load their own style and js.

美男兮 2024-10-14 23:01:23

对我来说,Google Analytics 库在我的其余部分之前插入了脚本。

For me, Google Analytics library inserted scripts before the rest of mine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文