我正在我的网站上实现purechat,它在所有浏览器上工作除了ie,但我很惊讶纯净聊天的内容在页面上显示,但在页面源中找不到它甚至找不到使用F12,通过查看ie中的元素,是否可以隐藏HTML使用??
答案 0 :(得分:5)
我知道使用IE开发人员工具,您需要使用查看区域上方的刷新图标刷新html。也许你可以尝试一下?
或者,很有可能purechat通过iframe很难在IE上查看。
作为第一步,我会尝试使用更好的开发工具(如Google Chrome浏览器)浏览浏览器来查找纯聊字代码。
<强>更新强>
经过进一步研究后,我发现purechat显示为html 而不是iframe 。我相信你遇到的问题是因为IE开发人员工具没有更新html。 点击该刷新按钮进行排序:)
Purechat的工作原理是将一些JavaScript注入您的页面,尝试在您的正文标记之前查找一些与此类似的代码:
<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">
<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>