如何使用 JavaScript 从 stackoverflow 页面内部获取用户编号?

发布于 2024-07-22 05:04:26 字数 71 浏览 2 评论 0原文

我正在尝试设置一个页面(如果它是堆栈溢出的一部分)将生成 Stackoverflow Flair Blogger Gadget。

I'm trying to set up a page that (if it were part of stack overflow) would generates a Stackoverflow Flair Blogger Gadget.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

音盲 2024-07-29 05:04:26

我不完全理解你的问题。

如果您必须使用 javascript 从此页面检索用户号码,则应解析 #hlinks 的第一个 a 元素的 href 属性。 例如,我的是“/users/recent/112870”,其中 112870 是我的用户号。

可能还有其他方法可以做到这一点,这是我想到的第一个方法。

I don't fully understand your question.

If you have to retrieve a user's number from this page with javascript, you should parse the href attribute of the first a element of #hlinks. Mine for example is "/users/recent/112870" where 112870 is my user number.

There might be other ways to do this, this is the first that came to my mind.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文