使用jQuery从Minecraft.net获取会话 [英] Use jQuery to get session from Minecraft.net

查看:92
本文介绍了使用jQuery从Minecraft.net获取会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
XmlHttpRequest错误:不允许原点为null通过Access-Control-Allow-Origin

Possible Duplicate:
XmlHttpRequest error: Origin null is not allowed by Access-Control-Allow-Origin

我正尝试使用jQuery从Minecraft.net中使用获取会话ID和内容

I'm trying to use jQuery to get session id's and stuff from Minecraft.net using

https://login.minecraft.net?user=<username>&password=<password>&version=99999

但是我无法获得它,因为有访问控制允许来源".我从服务器接收的数据甚至都不是json,这对我来说更难弄清楚如何使用javascript获取数据.我这样做是为了避免用户怀疑我要窃取他们的帐户.

But I can't get it because there is the "Access-Control-Allow-Origin". The data I receive from the server isn't even json which is even harder for me to figure out how to get data with javascript. I'm doing this so users won't go crazy with suspicions that I'm trying to steal their account.

这就像我收到的东西

1343825972000:deprecated:SirCmpwn:7ae9007b9909de05ea58e94199a33b30c310c69c:dba0c48e1c584963b9e93a038a66bb98

在此处了解更多信息. http://www.wiki.vg/Authentication#Login

Read more here. http://www.wiki.vg/Authentication#Login

推荐答案

您无法在该用户安装的插件之外的浏览器中执行此操作.

You can't do this in the browser, outside of a plugin installed by that user.

如果要转到该URL并获取这些值,则需要使用服务器端浏览器.机械化或phantomjs之类的东西很适合此类事情.

If you want to go to that url and get those values, you would need to use a server-side browser. Something like mechanize or phantomjs would be well suited for this sort of thing.

这篇关于使用jQuery从Minecraft.net获取会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆