gpt4 book ai didi

javascript - Google+ Plus 中的按钮。 .js 函数在哪里调用?

转载 作者:搜寻专家 更新时间:2023-10-31 22:23:03 24 4
gpt4 key购买 nike

今天我开始发现Google+的HTML代码

当我检查像“开始环聊”这样的按钮时,我看不到调用 javascript 代码的函数。看这里:

<div role="button" class="d-s-r tk3N6e-e tk3N6e-e-qc a-b-kh-fs a-kh-fs-e" tabindex="0" style="-webkit-user-select: none; ">Start a hangout</div>

没有 onclick() 函数。

知道它是如何工作的吗?也许是 Button 状态的观察者?这可能吗?

最佳答案

他们可能将外部 js 文件中的函数绑定(bind)到 id 或 class 选择器。

我不相信他们使用 jQuery(但他们很可能会),但这就是你在 jquery 中的外部 js 中的做法:

$("#id").click(function() {
//run onclick code
});

关于javascript - Google+ Plus 中的按钮。 .js 函数在哪里调用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6738279/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com