jQuery:这段代码的作用是什么?
l = $("#chat > div.monologue:last div.message:not(.pending):last");
l = $("#chat > div.monologue:last div.message:not(.pending):last");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最后一个
因为看起来您正在查看 SO 聊天代码,所以这是简单版本:
它正在获取最后一条聊天消息,该消息不是您刚刚发送的(并且尚未得到服务器确认)。
It's getting last the
<div class="message">
that doesn't have a the classpending"
that's a decendant of the last<div class="monologue">
that's a direct child of theid=chat"
element.Since it looks like you're looking at SO chat code, here's the plain version:
It's getting the last chat message that's not one you just sent (and hasn't been confirmed by the server).
它以
的最后一个
为了清楚起见,请看下面:
It targets the last
<div class="message">
of<div class="monologue">
and makes sure it doesn't havepending
in the class attribute. Now the parent div, which is<div class="monologue">
, should be the last from its parent div, which is<div id="chat">
.To make it clear see below: