IE开发者工具:源代码未显示完整HTML

3

我正在将PureChat添加到我的网站中,它在所有浏览器上都能正常工作,除了IE浏览器。但是我很惊讶的是,PureChat的内容显示在页面上,但在页面源代码中找不到它,甚至无法使用F12找到。通过在IE中查看元素,有可能隐藏HTML使其对用户不可见吗?enter image description here

1个回答

5
我知道在IE开发者工具中,您需要使用查看区域上方的刷新图标来刷新HTML。也许您可以尝试一下这个?另外,纯聊天可能是通过iframe工作的,在IE上很难查看。首先,我会尝试使用Google Chrome等具有更好开发工具的浏览器查找纯聊天代码。更新:经过进一步研究,我发现纯聊天出现为html而不是iframe。我认为您遇到的问题是因为IE开发人员工具没有更新HTML。点击刷新按钮以解决它 :)。纯聊天通过将一些JavaScript注入到您的页面中来工作,请尝试查找类似于此代码的body标签之前的一些代码:
<script type="text/javascript">
  (function () { var done = false; var script = document.createElement("script"); script.async = true; script.type = "text/javascript"; script.src = "https://www.purechat.com/VisitorWidget/WidgetScript"; document.getElementsByTagName('HEAD').item(0).appendChild(script); script.onreadystatechange = script.onload = function (e) { if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { var w = new PCWidget({ c: 'f509d702-fe1e-4761-9c6f-a386765ff3c7', f: true }); done = true; } }; })();
</script>

实际的Purechat小部件HTML代码如下:
<div class="purechat purechat-widget purechat-widget-collapsed purechat-bottom purechat-bottom-left">
  <div class="purechat-widget-inner purechat-clearfix">
    <div class="purechat-widget-header">
      <div class="purechat-menu btn-toolbar">
        <button class="btn btn-mini actions btn-collapse" style="display: none;"><i class="icon-minus"></i></button>
        <button class="btn btn-mini actions btn-expand"><i class="icon-plus"></i></button>
      </div>
      <div class="purechat-widget-title purechat-widget-title-collapsed">
        <img class="purechat-title-image" src="https://www.purechat.com/Content/images/icon-small.png">
        &nbsp;
        <span class="purechat-widget-title-link" title="Chat with us.">Chat with us.</span>
      </div>
    </div>
    <div class="purechat-content purechat-widget-content" style="display: none;">
      <div class="purechat-enterinfo-container">
        <p>Enter your name to begin!</p>
      </div>
      <form class="purechat-init-form" action="">
        <p class="alert alert-error init-error please-entername" style="display:none;">Please enter a name.</p>
        <input type="text" class="purechat-name-input" name="purechat-name-input" placeholder="Name" maxlength="40">
        <input type="submit" class="btn" id="purechat-name-submit" value="Send Chat Request">
      </form>
    </div>
    <div class="purechat-poweredby-container">
      <span class="purechat-poweredby">Powered by </span><a target="_blank" href="http://www.purechat.com">PureChat.com</a>
    </div>
  </div>
</div>

是的,我刷新了页面,但结果仍然相同,即使在Google Chrome、Mozilla甚至IE 9中,我也可以查看包含纯聊天的div,但在(BM-ie9,文档模式ie7标准)的情况下,我找不到任何东西在purechat内容中。 - Vijay Singh Rana
1
谢谢,我一直在刷新页面,但是当我从开发者工具中刷新时,它显示了一个div :) - Vijay Singh Rana

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接