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

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

      1. <tfoot id='txyG7'></tfoot>

          <bdo id='txyG7'></bdo><ul id='txyG7'></ul>
      2. 如何显示浏览器特定的 HTML?

        How to display browser specific HTML?(如何显示浏览器特定的 HTML?)
        <tfoot id='Gfb2z'></tfoot>

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

            <tbody id='Gfb2z'></tbody>

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

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

                  本文介绍了如何显示浏览器特定的 HTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试找到一种方法,使用 javascript 或条件注释(或任何其他方式)显示一个指向 IE 用户的链接和指向所有其他浏览器的另一个链接.

                  I'm trying to find a way to display one link to an IE user and another link to all other browsers using javascript or conditional comments (or whatever it takes).

                  基本上...

                  //pseudo code
                  <!--[if IE]>
                      <a href"ie-only.html">click here!</a>
                  <!--[else]>
                      <a href"all-other-browsers.html">click here!</a>
                  <![endif]-->
                  

                  我认为条件注释标签无法做到这一点(仅适用于 Internet Explorer).另外,我认为没有其他"声明.

                  I don't think this is possible with conditional comment tags (which only work in internet explorer). Plus I don't think there is an "else" statement.

                  有没有办法用 javascript 做到这一点?请帮忙!谢谢!

                  Is there a way to do this with javascript? Please help! Thanks!

                  推荐答案

                  我认为条件注释标签无法做到这一点(仅适用于 Internet Explorer)

                  I don't think this is possible with conditional comment tags (which only work in internet explorer)

                  确实如此.您只需将非 IE 浏览器的内容保留在某个位置,使其成为条件注释子句的一部分,但实际上不在 <!-- 注释 --> 内.然后不知道条件注释的浏览器会很好地看到内容.这被称为 downlevel-revealed条件注释.

                  Sure it is. You just have to leave the content for non-IE browsers in a position such that it's part of a conditional comment clause but not actually inside a <!-- comment -->. Then browsers that don't know about conditional comments will see the content fine. This is known as a downlevel-revealed conditional comment.

                  不幸的是,Microsoft 给您的标记是无效的 HTML(甚至不是格式良好的 XML).要使其通过集合,您只需要一些额外的--":

                  Unfortunately the markup Microsoft give you there is invalid HTML (and not even well-formed XML). To make it pass muster you just need a few additional ‘--’s:

                  <!--[if IE]> This is IE! <![endif]-->
                  <!--[if !IE]><!--> This ain't IE! <!--<![endif]-->
                  

                  虽然我不得不回应 AnonJr 的不回答,但与其他浏览器相比,您很少需要一个完全独立的 IE 链接/页面.如果你正在做一些棘手的事情,比如复杂的 VML 和 ActiveX 在 IE 中使用 Flash 在其他浏览器上工作,我想这可能是有原因的,但通常在同一个基本页面上进行一些 CSS 和脚本 hack 就足够了.

                  Although I have to echo AnonJr's non-answer, in that it's rare you should need a completely separate link/page for IE compared to other browsers. If you're doing something tricky like complex VML and ActiveX work in IE with Flash on other browsers I guess there could be a reason for it, but usually a few CSS and script hacks over the same basic page should suffice.

                  这篇关于如何显示浏览器特定的 HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Fetch multiple links inside foreach loop(在 foreach 循环中获取多个链接)
                  Backbone Fetch Request is OPTIONS method(Backbone Fetch Request 是 OPTIONS 方法)
                  Fetch API leaks memory in Chrome(Fetch API 在 Chrome 中泄漏内存)
                  How can I download and save a file using the Fetch API? (Node.js)(如何使用 Fetch API 下载和保存文件?(Node.js))
                  Send blob data to node using fetch, multer, express(使用 fetch、multer、express 将 blob 数据发送到节点)
                  Sending a custom User-Agent string along with my headers (fetch)(发送自定义用户代理字符串以及我的标头(获取))
                    1. <i id='ZFUH0'><tr id='ZFUH0'><dt id='ZFUH0'><q id='ZFUH0'><span id='ZFUH0'><b id='ZFUH0'><form id='ZFUH0'><ins id='ZFUH0'></ins><ul id='ZFUH0'></ul><sub id='ZFUH0'></sub></form><legend id='ZFUH0'></legend><bdo id='ZFUH0'><pre id='ZFUH0'><center id='ZFUH0'></center></pre></bdo></b><th id='ZFUH0'></th></span></q></dt></tr></i><div id='ZFUH0'><tfoot id='ZFUH0'></tfoot><dl id='ZFUH0'><fieldset id='ZFUH0'></fieldset></dl></div>

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

                        <tfoot id='ZFUH0'></tfoot>

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

                          <bdo id='ZFUH0'></bdo><ul id='ZFUH0'></ul>
                              <tbody id='ZFUH0'></tbody>