JavaScript:分析某人的网站:这个标签来自哪里?
我目前正在为新闻网站开发 GreaseMonkey 插件,其中有一个 标签,其中存储评论的评级数据,然后用于在帖子中显示它。
我正在 AJAX 加载多个评论页面,由于某种原因,此
标记没有显示在我的后台加载页面中。分析此标签的创建位置和方式的最佳方法是什么?
问题太宽泛? :) 问候
i'm currently working on a GreaseMonkey plugin for a news-site and they have a <script>
tag in there, where rating data for comments is stored and then used to display it along the posts.
I'm AJAX-loading several comment-pages and for some reason this <script>
tag doesn't show up in my background-loaded pages. What is the best way to analyze where and how this tag is created?
Too broad of a question? :)
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
curl
下载源 HTML,并查看服务器最初发送的 HTML 中是否存在标记。如果没有,很可能他们在页面加载后使用 javascript 将标签添加到 DOM。您必须查看他们的代码才能确定是否发生了这种情况。查找文档就绪事件的事件处理程序。
Download their source HTML with
curl
and see if the<script>
tag is present in the HTML as initially sent by their server. If not, most likely they are using javascript to add the tag to the DOM after the page is loaded. You'll have to look through their code to find if that is happening. Look for event handlers for the document ready event.