3

我正在我的网站上实现 purechat,它可以在除 ie 之外的所有浏览器上运行,但我很惊讶纯聊天的内容显示在页面上,但在页面源中找不到它,甚至无法使用 F12 找到,通过查看 ie 中的元素,是否可以隐藏 HTML 以防止使用?在此处输入图像描述?

4

1 回答 1

5

我知道使用 IE 开发人员工具,您需要使用查看区域上方的刷新图标来刷新 html。也许你可以试试?

或者,purechat 很可能通过在 IE 上难以查看的 iframe 工作。

作为第一步,我会尝试通过在具有更好的开发工具(如 Google Chrome)的浏览器上查找来查找 purechat 代码。


更新

经过进一步研究,我发现 purechat 显示为 html而不是 iframe。我相信您遇到的问题是因为 IE 开发人员工具尚未更新 html。点击刷新按钮对其进行排序:)

Purechat 通过在您的页面中注入一些 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>
于 2013-04-04T07:20:19.980 回答