<legend id='7u4tw'><style id='7u4tw'><dir id='7u4tw'><q id='7u4tw'></q></dir></style></legend>
        <bdo id='7u4tw'></bdo><ul id='7u4tw'></ul>

      <small id='7u4tw'></small><noframes id='7u4tw'>

      <tfoot id='7u4tw'></tfoot>

    1. <i id='7u4tw'><tr id='7u4tw'><dt id='7u4tw'><q id='7u4tw'><span id='7u4tw'><b id='7u4tw'><form id='7u4tw'><ins id='7u4tw'></ins><ul id='7u4tw'></ul><sub id='7u4tw'></sub></form><legend id='7u4tw'></legend><bdo id='7u4tw'><pre id='7u4tw'><center id='7u4tw'></center></pre></bdo></b><th id='7u4tw'></th></span></q></dt></tr></i><div id='7u4tw'><tfoot id='7u4tw'></tfoot><dl id='7u4tw'><fieldset id='7u4tw'></fieldset></dl></div>

        如何将脚本标签插入头部标签的顶部/开头?

        How do I insert a script tag in to the top/beginning of head tag?(如何将脚本标签插入头部标签的顶部/开头?)

            • <bdo id='CErSz'></bdo><ul id='CErSz'></ul>
              <tfoot id='CErSz'></tfoot>

                <legend id='CErSz'><style id='CErSz'><dir id='CErSz'><q id='CErSz'></q></dir></style></legend>
              • <small id='CErSz'></small><noframes id='CErSz'>

                    <tbody id='CErSz'></tbody>
                  <i id='CErSz'><tr id='CErSz'><dt id='CErSz'><q id='CErSz'><span id='CErSz'><b id='CErSz'><form id='CErSz'><ins id='CErSz'></ins><ul id='CErSz'></ul><sub id='CErSz'></sub></form><legend id='CErSz'></legend><bdo id='CErSz'><pre id='CErSz'><center id='CErSz'></center></pre></bdo></b><th id='CErSz'></th></span></q></dt></tr></i><div id='CErSz'><tfoot id='CErSz'></tfoot><dl id='CErSz'><fieldset id='CErSz'></fieldset></dl></div>
                  本文介绍了如何将脚本标签插入头部标签的顶部/开头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想在 head 标记中的所有其他脚本之前插入一个脚本标记.我将如何使用原生 javascript 做到这一点?

                  I want to insert a script tag before all the rest of the scripts in the head tag. How would I do that with native javascript?

                  <head>
                      //INSERT SCRIPT HERE
                       <script type="text/javascript" src="common.js"></script>
                       <script type="text/javascript" src="omni-controls.js"></script>
                  </head>
                  

                  当我使用它时,它只是附加在头标签中的所有标签之后.

                  When I use this, it just appends after all the tags in the head tag.

                  document.getElementsByTagName("head")[0].appendChild(script);
                  

                  推荐答案

                  var head = document.getElementsByTagName("head")[0]
                  
                  head.insertBefore(script, head.firstChild);
                  

                  这篇关于如何将脚本标签插入头部标签的顶部/开头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Toggle HTML radio button by clicking its label(通过单击标签来切换 HTML 单选按钮)
                  Javascript how to change radio button label text?(Javascript如何更改单选按钮标签文本?)
                  JavaScript radio button confirmation(JavaScript 单选按钮确认)
                  How can I automatically select specific radio buttons with Greasemonkey?(如何使用 Greasemonkey 自动选择特定的单选按钮?)
                  AngularJs. Is it possible to deselect HTML “radio” input by click?(AngularJs.是否可以通过单击取消选择 HTML“收音机输入?)
                  Checking Value of Radio Button Group via JavaScript?(通过 JavaScript 检查单选按钮组的值?)
                      <tbody id='bWXzk'></tbody>

                    <small id='bWXzk'></small><noframes id='bWXzk'>

                    • <bdo id='bWXzk'></bdo><ul id='bWXzk'></ul>
                      1. <tfoot id='bWXzk'></tfoot>

                          <i id='bWXzk'><tr id='bWXzk'><dt id='bWXzk'><q id='bWXzk'><span id='bWXzk'><b id='bWXzk'><form id='bWXzk'><ins id='bWXzk'></ins><ul id='bWXzk'></ul><sub id='bWXzk'></sub></form><legend id='bWXzk'></legend><bdo id='bWXzk'><pre id='bWXzk'><center id='bWXzk'></center></pre></bdo></b><th id='bWXzk'></th></span></q></dt></tr></i><div id='bWXzk'><tfoot id='bWXzk'></tfoot><dl id='bWXzk'><fieldset id='bWXzk'></fieldset></dl></div>

                          <legend id='bWXzk'><style id='bWXzk'><dir id='bWXzk'><q id='bWXzk'></q></dir></style></legend>